#include
int main()
{
float x;
char t;
while(1){
printf("input type and distance:\n");
scanf(" %c %f",&t,&x); fflush(stdin);
if (t=='C'){ printf("%g\n",0.50*x);
} else if (t=='T'){ printf("%g\n",1.00 *x);
} else if (t=='B'){ printf("%g\n",1.50 *x);
} else { printf("no the type\n");break;};
};
return 0;
}
可以输入多组,直到输入类型 不是规定的 种类(字母)。
看不清啊。