  
|
if...else 判斷式
 - #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;
- }
複製代碼 |
|