我运用DEV-C++ 编写程序,在#include<stdafx.h>这里报错
下面就是我的程序,如果加上 #include<stdafx.h> 显示 [Error] stdafx.h: No such file or directory但是去掉的话,全篇程序都会出现问题,望大家给我指导一下,谢谢。
#include<stdafx.h>
#include<iostream>
using namespace std;
class Cylinder
{
private:
float radius,high;
public:
Cylinder(float r,float h);
float Low Area(void);
float Superficial Area(void);
float Volume(void);
};
Cylinder::Cylinder(float r,float h):radius(r),high(h){
}
float Cylinder::Low Area(void){
return 3.14*r*r;
}
float Cylinder::Superficial Area(void){
return 2*3.14*r*r+(2*r*3.14)*h;
}
float Cyliner::Volume(void){
return 3.14*r*r*h;
}
void main()
{
float r,h;
cout<<"输入圆柱的底面半径和高:";
cin>>r>>h;
Cyliner circle(r,h);
cout<<"底面积为"<<circle.Low Area()<<endl;
cout<<"表面积为"<<circle.Superficial Area()<<endl;
cout<<"体积为"<<circle.Volume()<<endl;
System ("pause");
return 0;
}