水果店水果标价13.8一斤打出来的价格是27.6一斤为啥

2023-08-24 07:16:13 来源:网友发布 作者:网友发布

水果店水果标价13.8一斤打出来的价格是27.6一斤是因为打出来的价格单位是每公斤的单价。根据查询相关资料信息显示,水果店标价是每斤13.8元,打出来的价格是每公斤27.6元,其中两斤等于一公斤。

#include<stdio.h>

int?main(){

int?i,n,a[4]={30,25,41,102};

char?s[5][10]={"apple","pear","orange","grape","exit"};

for(i=0;i<5;i++)?printf("[%d]?%sn",(i+1)%5,s[i]);

for(i=0;i<5;i++){

scanf("%d",&n);

if(!n){break;}

else?if(n>0&&n<5){printf("price=%.2fn",a[n-1]/10.0);}

}

return?0;

}

[willie@bogon zhidao]$ gcc shuiguo.c -o shuiguo.o

[willie@bogon zhidao]$ ./shuiguo.o

[1] apple

[2] pear

[3] orange

[4] grape

[0] exit

1

price=3.00

2

price=2.50

3

price=4.10

4

price=10.20

5

同类最新

(c)2008-2023  Www.QNWTOP.Com All Rights Reserved