返回列表 發帖

if...else 判斷式

  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 a,b;
  7.    
  8.     cout<<"請輸入a:";
  9.     cin>>a;      
  10.     cout<<"請輸入b:";
  11.     cin>>b;
  12.    
  13.     cout<<"a="<<a<<endl;
  14.     cout<<"b="<<b<<endl;
  15.    
  16.     if(a>b)
  17.         cout<<"a大於b"<<endl;
  18.      else if(a<b)
  19.         cout<<"a小於b"<<endl;      
  20.     else
  21.         cout<<"a等於b"<<endl;
  22.         
  23.     system("pause");
  24.     return 0;   
  25. }
複製代碼

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>=90)
  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>=)
  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<<"please report your score: ";
  8.    cin>>score;
  9.    if(score>=60)
  10.    {
  11.         cout<<"congraduations!you'd passed!'"<<endl;
  12.    }else
  13.    {
  14.         cout<<"hey!you're a dumb idiot'"<<endl;
  15.    }
  16.    system("pause");   
  17.    return 0;
複製代碼

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<<"這樣不行,再加油!";
  15.     }
  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.    
  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. }
複製代碼

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.    
  10.    if(score>=60)
  11.    {
  12.         cout<<"恭喜你! 及格了!"<<endl;
  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. }
複製代碼

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.    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

返回列表