#5315: OLE??

#### CSE911413 (David)

School : 國立臺中高級工業職業學校
ID : 15788
2018-11-28 23:34:44
c002. 10696 - f91 -- | From: [180.92.1.105] | Post Date : 2011-07-07 12:29

#include<iostream>
using namespace std;
int main() {

int x,f91;

while(cin >> x){
if(x<=100){
f91=x+11;
cout << "f91""("<< x <<")"" = "<< "91" << endl;
}
else if(x>=101){
f91=x-10;
cout << "f91""("<< x <<")"" = "<< f91 << endl;
}
if(x==0)
break;

if(x>=1000001)
break;
}

return 0;

}

* 累贅的輸出，請勿輸出題目未要求的文字

#5318: Re:OLE??

#### grd (保持好奇心)

School : 臺中市私立明道高級中學
ID : 18826
2019-01-21 21:20:44
c002. 10696 - f91 -- | From: [114.38.25.174] | Post Date : 2011-07-07 16:38

"若 N=0 代表輸入結束。"

所以說pascal下是 if n=0 then break;

#13048: Re:OLE??

#### timmy940410 (♂千羽▄︻┻═┳一)

School : 臺北市私立延平高級中學
ID : 69053
2019-05-08 17:25:46
c002. 10696 - f91 -- | From: [114.32.213.13] | Post Date : 2017-11-25 16:16

"若 N=0 代表輸入結束。"

所以說pascal下是 if n=0 then break;

#include<iostream>
using namespace std;
int main() {
int x;
while(cin >> x){
if(x==0){
return 0;
}
int f91;
if(x<=100){
cout << "f91"<<"("<< x <<")"<<" = "<< "91" << endl;
}else if(x>=101){
f91=x-10;
cout << "f91""("<< x <<")"" = "<< f91 << endl;
}
}
}//我改了一下你的寫法，結果AC......

ZeroJudge Forum