標題:
if...else 判斷式
[打印本頁]
作者:
tonyh
時間:
2016-3-19 10:30
標題:
if...else 判斷式
本帖最後由 tonyh 於 2016-3-19 10:50 編輯
[attach]1569[/attach]
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score; //變數名稱與要做的事有一定程度的相關
re:
cout<<"請輸入你的成績: ";
cin>>score;
if(score>=60)
cout<<"恭喜你及格了,給你糖吃!"<<endl;
else
cout<<"不及格!打屁股!"<<endl;
goto re;
system("pause");
return 0;
}
複製代碼
作者:
黃茂勛
時間:
2016-3-19 10:57
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re:
int score;
cout<<"請輸入你的成績: ";
cin>>score;
if(score>=60)
cout<<"恭喜你及格了!"<<endl;
else
cout<<"不及格!去吃大便吧!"<<endl;
goto re;
system("pause");
return 0;
}
複製代碼
作者:
任立宇
時間:
2016-3-19 10:58
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score;
cout<<"成績"<<endl
cin>>score;
if(score>=60)
cout<<"好棒棒"<<endl
else
cout<<"屎吧你"<<endl
syatam()
return 0;
}
複製代碼
作者:
方宥鈞
時間:
2016-3-19 10:58
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
f:
int x;
cout<<"請輸入你的成績: ";
cin>>x;
if(x>=60)
cout<<"恭喜,通過考試了!!!!!!!!!!!!"<<endl;
else
cout<<"去吃大便!!!"<<endl;
goto f;
system("pause");
return 0;
}
複製代碼
作者:
張孟軒
時間:
2016-3-19 10:59
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score;
re:
cout<<"請輸入你的成績:";
cin>>score;
if(score>=60)
cout<<"恭喜你及格了,給你糖吃"<<endl;
else
cout<<"不及格,打屁股!"<<endl;
goto re;
system("pause");
return 0;
}
複製代碼
作者:
高允懋
時間:
2016-3-19 11:01
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
a:
int x;
cout<<"請輸入你的成績:";
cin>>x;
if(x>=60)
cout<<"恭喜你及格了!給你糖吃!"<<endl;
else
cout<<"不及格!打屁股!"<<endl;
goto a;
system ("pause");
return 0;
}
複製代碼
作者:
陳泓瑜
時間:
2016-3-19 11:03
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int scr;
cout<<"PLEASE ENTER THE TEST SCORE: ";
cin>>scr;
if(scr>=75)
cout<<"HOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOORRRRRRRRRAAAAAAYYYYYYYYYYYYYYYYYY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<endl;
else
cout<<"NNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO,WHYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY???????????????????????????????"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
陸長辰
時間:
2016-3-19 11:05
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int score;
cout<<"請輸入你的成績:";
cin>>score;
if(score>=60)
cout<<"恭喜你及格了"<<endl;
else
cout<<"恭喜你不及格"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
康湍榆
時間:
2016-3-19 11:08
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re:
int score;
cout <<"請輸入你的成績:";
cin>>score;
if(score>=60)
cout<<"恭喜你及格了!";
else
cout<<"不及格!";
cout <<endl;
goto re;
system("pause");
return 0;
}
複製代碼
回復
1#
tonyh
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2