#include<stdio.h>
int main()
{
char kind;
float sum = 0;
float k = 0;
int count = 0;
while(1)
{
printf("请è¾å
¥è½¦è¾ç§ç±»ï¼A/B/C\n");
scanf("%c",&kind);
printf("请è¾å
¥å
¬éæ°ï¼");
scanf("%f",&k);
switch(kind)
{
case 'A':
case 'a': sum = sum + k*0.5; count++; break;
case 'B':
case 'b': sum = sum + k*0.4; count++; break;
case 'C':
case 'c': sum = sum + k*0.3; count++; break;
}
if(count==50)
{
printf("满50è¾è½¦ï¼å
±æ¶è´¹%få
ã",sum);
break;
}
}
return 0;
}
温馨提示:内容为网友见解,仅供参考