#include <iostream>
#include <cmath>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv)
{ int x,y;
while(cin>>x>>y)
{ int yee;
for(int a;a>0;a--)
{
cin>>a;
int r;
int l;
l=x+y;
r=pow(l,0.5);
yee=100-(r*r);}
if(0<yee&&yee<=30)
cout<< "sad!"<<endl;
else if(30<yee&&yee<=60)
cout<<"hmm~~"<<endl;
else if(60<yee&&yee<100)
cout<<"Happyyummy"<<endl;
else if(0>yee||100<yee)cout<<"evil!!"<<endl;
}
return 0;
}
為什麼錯啊??是我程式語法錯???
#include
#include
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv)
{ int x,y;
while(cin>>x>>y)
{ int yee;
for(int a;a>0;a--)
{
cin>>a;
int r;
int l;
l=x+y;
r=pow(l,0.5);
yee=100-(r*r);}
if(0<yee&&yee<=30)
cout<< "sad!"<<endl;
else if(30<yee&&yee<=60)
cout<<"hmm~~"<<endl;
else if(60<yee&&yee<100)
cout<<"Happyyummy"<<endl;
else if(0>yee||100<yee)cout<<"evil!!"<<endl;
}
return 0;
}
為什麼錯啊??是我程式語法錯???
你的R用 int 接可是你有開根號欸0u0