2024-11-23 03:43:06
2024-11-23 05:23:00
#include <stdio.h>
int main()
{
int c,d;
float w,p;
printf("Input payment:");
scanf("%f",&p);
if(p>=1000)c=10;
else c=p/100;
switch(c)
{
case 0:
d=0;
break;
case 1:
d=5;
break;
case 2:
case 3:
case 4:
d=8;
break;
case 5:
case 6:
case 7:
case 8:
case 9:
d=10;
break;
case 10:
d=15;
break;
default:
printf("error");
break;
}
w=p*(1-d/100.0);
printf("price = %.1f\n",w);
return 0;
}
2024-11-23 03:55:13
非常给力的搞笑,谢谢咯。初学没办法,女孩子学这方面没兴趣,碍于是作业。