作业,帮看看哪错了。。。
程序代码:
#include <stdio.h> int main1() { double sex,high,weight,goodweight; printf("请输入您的性别,男=1,女=0,sex= \n"); scanf("%d\n",&sex); printf("请输入您的身高(单位cm),high= \n"); scanf("%f\n",&high); printf("请输入您的体重(单位KG),weight= \n"); scanf("%f\n",&weight); if(sex) { goodweight = (high-100)*0.9;} else {goodweight = (high-100)*0.9-2.5;} if((weight <= 0.6*goodweight)) printf("很遗憾,您已经脱离正常人范围了,请立即去救助站~!"); if((weight >= 0.6*goodweight))&&((weight <= 0.8*goodweight)) printf("您处于消瘦状态,请增重%dkg,多吃多锻炼",(int)(goodweight-weight+1)); if((weight >= 0.8*goodweight))&&((weight <= 0.9*goodweight)) printf("您处于偏瘦状态,请增重%dkg,适当锻炼身体",(int)(goodweight-weight+1)); if((weight >= 0.9*goodweight))&&((weight <= 1.1*goodweight)) printf("恭喜您,您的体重正常,请保持",); if((weight >= 1.3*goodweight))&&((weight <= 1.5*goodweight)) printf("您处于偏胖状态,请减轻%dkg,多吃蔬菜少吃肉",(int)(weight-goodweight+1)); if((weight >= 1.5*goodweight))&&((weight <= 1.8*goodweight)) printf("您处于肥胖状态,请减轻%dkg,只吃蔬菜不吃肉",(int)(weight-goodweight+1)); if((weight >= 0.6*goodweight)) printf("我对您深表同情。。。"); getchar(); getchar(); return 0; } 错误 4 error C2143: 语法错误 : 缺少“;”(在“&&”的前面) 警告 5 warning C4390: “;”: 找到空的受控语句;这是否是有意的?