|
#include<stdio.h> void main() { float weight=0; float pay=0; printf("请输入邮件重量(单位:g):"); scanf("%f",&weight); if(weight>100) { pay=100*0.05+(weight-100)*0.02; } else { pay=weight*0.05; } printf("\n需要支付:%f元",pay); } 2.
#include<stdio.h> void main() { float x=0; float y=0; printf("请输入x的值:"); scanf("%f",&x); if(x<=0) { y=x; } else if(x>0 && x<1) { y=2*x; } else {
完整课后答案请下载附件,回复本帖子即可查看解压密码
|
|