69,382
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
int main() {
float a;
float b = 50.00;
printf("please input A");
scanf("%f", a);
if (a >= b) {
printf("A=%.lf > or = 50", a);
if (a >= 80) {
printf("A >= 80 YES");
}
else{
printf("A < 80 No");
}
}
else {
printf("A=%.lf<50", a);
}
return 0;
}
我猜·········,b就用了一次,其实不必整个变量出来,直接用值就可以了#include <stdio.h>
int main() {
float a;
float b = 50.00;
float c;
printf("please input A");
scanf("%f", a);
if (a >= b) {
printf("A=%.lf > or = 50", a);
if (a = 80) {
c = (a >= 80);
}
if(c == 1){
printf("A >= 80 YES");
}
else{
printf("A < 80 No");
}
}
else {
printf("A=%.lf<50", a);
}
return 0;
}
你是不是这个意思,你的代码写的让我头疼······
我觉得c就是个多余的