Board logo

標題: if...else 判斷式 [打印本頁]

作者: 蔡昀儒    時間: 2019-7-30 09:07     標題: if...else 判斷式

[attach]6899[/attach]
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    int score;
  7.    cout<<"報上你的成績: ";
  8.    cin>>score;
  9.    if(score>=60)
  10.    {
  11.         cout<<"恭喜你! 及格了!"<<endl;
  12.    }else
  13.    {
  14.         cout<<"不及格~ 斬!"<<endl;
  15.    }
  16.    system("pause");   
  17.    return 0;
  18. }
複製代碼

作者: 薛博仁    時間: 2019-7-30 09:26

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x;
  7.     cout<<"請輸入你的成績"<<endl;
  8.     cin>>x;
  9.     if(x>=60)
  10.     {
  11.     cout<<"及格!蒸蚌!" <<endl;
  12.     }
  13. else
  14. {
  15. cout<<"不及格!再加油!"<<endl;
  16. }
  17. system("pause");
  18. return 0;
  19. }
複製代碼

作者: 龔品誠    時間: 2019-7-30 09:29

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x;
  7.     cout<<"請輸入你的成績:";
  8.     cin>>x;
  9.     if(x>=60)
  10.     {
  11.     cout<<"恭喜你及格了"<<endl;         
  12.              }
  13.     else
  14.     {
  15.     cout<<"你不及格!!!!!!!!!!";   
  16.                                   }                        
  17.     system("pause");   
  18.    return 0;
  19. }
複製代碼

作者: 黃鋐粟    時間: 2019-7-30 09:33

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int m;
  7.     cout<<"你的分數:";
  8.     cin>>m;
  9.     if(m>=60)
  10.     {
  11.             cout<<"恭喜及格了"<<endl;
  12.             }
  13.     else
  14.     {
  15.              cout<<"不及格!"<<endl;
  16.              }
  17.     system("pause");
  18.     return 0;
  19. }
複製代碼

作者: 立晟    時間: 2019-7-30 09:44

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x;
  7.     cout<<"請輸入成績:"<<endl;
  8.     cin>>x;
  9.    
  10.     if (x>=60)
  11.     {
  12.     cout<<"恭喜你及格了"<<endl;
  13. }
  14.     else
  15.     {
  16.     cout<<"不及格"<<endl;
  17. }
  18. system("pause");
  19. return 0;   
  20. }
複製代碼

作者: 陳柏臻    時間: 2019-7-30 09:45

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6. cout<<"請輸入一個分數"<<endl;
  7. int x;
  8. cin>>x;
  9. if(x>=60)
  10. {cout<<"恭喜你及格了";}
  11. else
  12. {cout<<"不及格!";}


  13. system("pause");
  14. return 0;
  15. }
複製代碼

作者: 張博評    時間: 2019-7-30 09:48

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x;
  7.     cout<<"請輸入你的成績:"<<endl;
  8.     cin>>x;
  9.     if (x>=60)
  10.     cout<<"恭喜你及格了!"<<endl;
  11.     else
  12.     cout<<"不及格!"<<endl;
  13.     system("pause");
  14.     return 0;
  15. }
複製代碼





歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/) Powered by Discuz! 7.2