返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int score=60;
  7.     if(score >=70)
  8. {
  9.   
  10.   cout << "及格" << endl;      
  11. }         
  12. else
  13. {
  14.          
  15.    cout << "不及格"  <<endl;
  16.          
  17.          
  18. }        
  19.   system("pause");
  20.     return 0;
  21. }
複製代碼

TOP

  1. {
  2.    int h;
  3.    int y;
  4.    
  5.    cout<<"請輸入h";
  6.    cin>>h;
  7.    cout<<"請輸入y";
  8.    cin>>y;
  9.    cout<<"h="<<h<<endl;
  10.    cout<<"y="<<y<<endl;
  11.    if(h>y)
  12.    {
  13.           cout<<"h大於y"<<endl;
  14. }
  15. else if(h<y)
  16. {
  17.       cout<<"h小於y"<<endl;
  18. }
  19. else
  20. {
  21.     cout<<"h等於y"<<endl;
  22. }   
  23.   system("pause");
  24.     return 0;
  25. }
複製代碼

TOP

返回列表