修改好了,在C++里面判断400
#include
#include
using namespace std;
double countPAR(double P,double gn1)
{
const double NI=2000;
if(0
else if(400
else if(800<=gn1&&gn1<=1200)
P=gn1/NI+0.1;
else if(1200
else
P=gn1/NI-0.1;
return P;
}
int main()
{
double gn;
double PAR=0;
cout<<"please enter gn:";
cin>>gn;
cout<
}
//#include
#include
#include
using namespace std;
double countPAR(double P,int gn1)
{
const int NI=2000;
if(0
else
{
if(400
else
{
if(800<=gn1<=1200)
P=gn1/NI+0.1;
else
{
if(1200
else
P=gn1/NI-0.1;
}
}
}
return P;
}
int main()
{
int gn;
double PAR=0;
cout<<"please enter gn:";
cin>>gn;
countPAR(PAR,gn);
cout<
}
我看了下
我的c++没有库文件'stdafx.h'
c:\hhjf\kj.cpp(1) : fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
不知道你的是不是这样