题解 | 网购
网购
https://www.nowcoder.com/practice/5d7dfd405e5f4e4fbfdff6862c46b751
#include <stdio.h>
int main() {
int b,c,d;
double a,toll;
scanf("%lf ",&a);
scanf("%d %d %d", &b,&c,&d);
if(b==12&&c==12) {
if(d==1)
toll=(a*0.8-50.00);
if(d==0)
toll=(a*0.8);
}
if(b==11&&b==11){
if(d==1)
toll=(a*0.7-50.00);
if(d==0)
toll=(a*0.7);
}
if(toll<=0)
printf("0.00");
else
printf("%.2lf\n", toll);
return 0;
}
我写的较为复杂,用了多个条件语句
查看11道真题和解析