一:
#include
int main()
{
int score;
printf("请输入成绩:\n");
scanf("%d",&score);
if(score=0)
switch(score/10)
{
case 10:
case 9:
printf("A\n");
break;
case 8:
printf("B\n");
break;
case 7:
printf("C\n");
break;
case 6:
printf("D\n");
break;
default:
printf("E\n");
break;
}
else
printf("成绩有误\n");
return 0;
}
二:
#include
main()
{
int t;
double a,rate;
printf("请输入奖金数a:\n");
scanf("%lf",&a);
t=(int)(a/500);
switch(t)
{
case 0:
rate=0.00;
printf("a=%lf\nrate=%lf\ntax=%lf\nprofit=%lf\n",a,rate,a*rate,a*(1-rate));
break;
case 1:
rate=0.05;
printf("a=%lf\nrate=%lf\ntax=%lf\nprofit=%lf\n",a,rate,a*rate,a*(1-rate));
break;
case 2:
case 3:
rate=0.08;
printf("a=%lf\nrate=%lf\ntax=%lf\nprofit=%lf\n",a,rate,a*rate,a*(1-rate));
break;
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
rate=0.10;
printf("a=%lf\nrate=%lf\ntax=%lf\nprofit=%lf\n",a,rate,a*rate,a*(1-rate));
break;
default:
rate=0.15;
printf("a=%lf\nrate=%lf\ntax=%lf\nprofit=%lf\n",a,rate,a*rate,a*(1-rate));
break;
}
}
三:
#include
int main()
{
int n,i,flag=0;
printf("请输入一个数:\n");
scanf("%d",&n);
if(n
解析看不懂?求助智能家教解答查看解答