回复 10楼 杭01
我打错了一个字符。改了之后。还是有问题。。。1>------ 已启动生成: 项目: eg1, 配置: Debug Win32 ------
1> demo.c
1>d:\我的文档\visual studio 2010\projects\eg1\eg1\demo.c(22): error C2059: 语法错误:“return”
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
#include <stdio.h> #include <stdlib.h> int main() { float salary,DF; printf("Please input salary:"); scanf("%f",&salary); if(salary<=3000) { DF=salary*0.005; printf("Tax is:%.2f\n",DF); } else if(salary<=5000) { DF=salary*0.01; printf("Tax is:%.2f\n",DF); } else if(salary<=10000) { DF=salary*0.015; printf("Tax is:%.2f\n",DF); } else { DF=salary*0.02; printf("Tax is:%.2f\n",DF); } system("pause"); return 0; }