求解答C语言程序题

2024-12-17 19:41:18
推荐回答(5个)
回答1:

#include "stdio.h"
void main()
{
int profit,ticheng;
printf("请输入某月所接工程的利润\n");
scanf("%d",&profit);
if(profit<=1000) printf("你的总薪水是%d\n",500);
if(profit>1000&&profit<=2000) printf("你的总薪水是%d\n",500+500*0.1);
if(profit>2000&&profit<=5000) printf("你的总薪水是%d\n",500+500*0.15);
if(profit>5000&&profit<=10000) printf("你的总薪水是%d\n",500+500*0.2);
if(profit>10000) printf("你的总薪水是%d\n",500+500*0.25);
}

回答2:

#include
void main ()
{

double profit, sum;
printf("请输入工程利润:\n") ;
scanf("%lf",&profit);
if(profit<=1000){
sum=500;
printf("你的工资是:%lf",sum ); }
else if(1000sum = 500 + profit/10 ;
printf("你的工资是:%lf",sum ); }
else if(2000
sum = 500 + (profit*15)/100 ;
printf("你的工资是:%lf",sum ); }
else if(5000 sum = 500 + (profit*20)/100 ;
printf("你的工资是:%lf",sum ); }
else{
sum = 500 + (profit*25)/100 ;
printf("你的工资是:%lf",sum ); }
getch();
}

回答3:

main(){
int profit;
scanf(%d,&profit);
if(profit<=1000) profit = profit;
if(profit>1000&&profit<=2000) profit = profit + profit*10/100;
if(profit>2000&&profit<=5000) profit = profit + profit*15/100;
if(profit>5000&&profit<=10000) profit = profit + profit*20/100;
if(profit>10000) profit = profit + profit*25/100;
printf("salary = %d\n", profit);
}
没调试,随意写的

回答4:

那麼简单 只是对一个变量的取值范围的判断而已

回答5:

很简单 马上就好