#12362: WA line1


weir_lin (unnamed)

學校 : 臺北市私立延平高級中學
編號 : 60250
來源 : [203.72.178.252]
最後登入時間 :
2017-07-13 14:01:59
b884. 電腦教室的傑克 | From: [203.72.178.252] | 發表日期 : 2017-07-12 14:55

#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;
}

 

 

 

為什麼錯啊??是我程式語法錯???

 

 
#12365: Re:WA line1


justinO__o (夜貓)

學校 : 臺北市立成功高級中學
編號 : 51052
來源 : [61.216.80.115]
最後登入時間 :
2023-12-25 15:06:44
b884. 電腦教室的傑克 | From: [101.8.201.220] | 發表日期 : 2017-07-12 19:42

#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

 

 
ZeroJudge Forum