我小改了下你看看
#include <stdio.h>
main()
{ int i,k,huor=10,huors=15;
char j;
float sum=0;
printf("Input your number");
scanf("%d",&i);
printf("shi fou jiaban?Y or N");
fflush(stdin);
scanf("%c",&j);
if (j=='y' || j=='Y')
{
printf("jia ban shi jian:");
scanf("%d",&k);
sum=i*huor+k*huors;
}
else
{
sum=i*huor;
}
printf("%.2f\n",sum);
if(sum>0&&sum<300)
printf("%.2f",sum*=0.9);
else if(sum>300&&sum<1000)
printf("%.2f",sum*=0.85);
else if (sum>1000)
printf("%.2f",sum*=0.75);
}
#include <stdio.h>
main(){
int t;
float m,n;
char a;
printf("your work time(hour)\n");
scanf("%d",&t);
getchar();
printf("extral working?(y/n)\n");
scanf("%c",&a);
if(a=='y') m=15*t;
else m=15*t;
n=(m<=300l?(m*0.9):(m<=1000l?(m*0.85):(m*0.75)));
printf("total--%.2f ** actual--%.2f\n",m,n);
}
这个怎么样......