为什么会有这样的错误?
#include<stdio.h>#include<stdlib.h>
void main()
{
long i;
float bonus,bonl,bon2,bon4,bon6,bon10;
bonl=100000*0.1;
bon2=bon1+100000*0.075;
bon4=bon2+200000*0.05;
bon6=bon4+200000*0.03;
bon10=bon6+400000*0.015;
printf("请输入利润i:");
scanf("%ld",&i);
if(i<=100000)
bonus=i*0.1;
else if(i<=200000)
bonus=bon1+(i-100000)*0.075;
else if(i<=400000)
bonus=bon2+(i-200000)*0.05;
else if(i<=600000)
bonus=bon4+(i-400000)*0.03;
else if(i<=1000000)
bonus=bon6+(i-600000)*0.015;
else
bonus=bon10+(i-1000000)*0.01;
printf("奖金是%10.2f\n",bonus);
system("pause");
}
[Error] D:\My Documents\C-Free\Temp\未命名2.cpp:4: error: `main' must return `int'
[Error] D:\My Documents\C-Free\Temp\未命名2.cpp:8: error: `bon1' was not declared in this scope
[Warning] D:\My Documents\C-Free\Temp\未命名2.cpp:29:2: warning: no newline at end of file
我是照着书上的代码打的 这是什么情况呢