error:'main' must return 'int'
#include<iostream.h>using namespace std;
//类的定义;
class Circle
{
public:
float radius;//圆的半径
float area();//圆的面积
float perimeter();//圆的周长
};
//类的实现
float Circle::area()
{
return radius*radius*3.14159;
}
float Circle::perimeter()
{
return 2*3.14159*radius;
}
//类的使用对象
void main()
{
Circle c;
float areaOfc,perimeterOfc;
cout<<"请输入圆的半径:";
cin>>c.radius;
if(c.radius<0)
cout<<"半径不能为负数!\n";
else
{
areaOfc=c.area();
perimeterOfc=c.perimeter();
cout<<"半径为"<<c.radius<<"的圆的面积为:"<<areaOfc;
cout<<"半径为"<<c.radius<<"的圆的面积为:"<<perimeterOfc;
}
}
编译后为什么 错误 1,'main'函数必须返回’int' ?