返回列表 發帖

if...else 判斷式

本帖最後由 tonyh 於 2016-7-14 14:02 編輯

  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. }
複製代碼

  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.     }
  13.     else
  14.     {
  15.     cout<<"不及格"<<endl;
  16.     }
  17.     system("pause");
  18.     return 0;
  19. }
複製代碼
回復 1# tonyh

TOP

  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. }
複製代碼

TOP

  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<<"你及格了!!";
  12.    }else
  13.    {
  14.        cout<<"不及格!腰斬!"<<endl;
  15.    }
  16.     system("pause");
  17.     return 0;
  18. }
複製代碼

TOP

  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.                   
  13.     }else
  14.     {
  15.        cout<<"不及格!請再加油!!"<<endl;  
  16.     }
  17.     system ("pause");
  18.     return 0;
  19. }
複製代碼

TOP

  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. }
複製代碼
回復 1# tonyh

TOP

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

TOP

  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<<"你及格了!!";
  12.    }else
  13.    {
  14.        cout<<"不及格!腰斬!"<<endl;
  15.    }
  16.     system("pause");
  17.     return 0;
  18. }
複製代碼
康睿群

TOP

本帖最後由 曾彥翔 於 2016-7-13 17:26 編輯

回復 1# tonyh
  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. }
複製代碼

TOP

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

TOP

  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.         cout<<"你好厲害"<<endl;         
  11.     else
  12.         cout<<"你要再加油"<<endl;
  13.         system("pause");
  14.     return 0;
  15. }
複製代碼

TOP

  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. }
複製代碼
蔡茿后

TOP

  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. }
複製代碼

TOP

  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. }            
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;

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

TOP

回復 1# tonyh

TOP

返回列表