选择结构2

作者: 时间:2020-07-10 点击数:

分析:
     输入个人收入--》income
  if (,5000)
     tax=0*income;
  else if [5000,7000)
     tax=income*0.1;
  else if [7000,9000)
     tax=income*0.2;
  else if [9000,10000)
     tax=income*0.3;
  else
      tax=income*0.4;
  输出tax的值

#include <stdio.h>
int main()
{
float income,tax;
scanf("%f",&income);
if (income<5000)
 tax=0;
else if (income<7000)    //默认的income>=5000
 tax=income*0.1;
else if (income<9000)
 tax=income*0.2;
else if (income<10000)
 tax=income*0.3;
else
 tax=income*0.4;
printf("%.2f\n",tax);
return 0;}

上一页 [1] [2] [3] [4] 下一页

Copyright© 2020 Anyang Institute of Technology.All rights reserved.

学院地址:河南省安阳市黄河大道西段