返回列表 發帖

基本輸入輸出

本帖最後由 tonyh 於 2015-7-24 15:32 編輯

基本輸入輸出練習
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x,y;   //宣告整數變數 int-->integer
  7.     cout<<"請輸入x的值: ";
  8.     cin>>x;
  9.     cout<<"請輸入y的值: ";
  10.     cin>>y;
  11.     cout<<"x="<<x<<endl;
  12.     cout<<"y="<<y<<endl;   
  13.     system("pause");
  14.     return 0;   
  15. }
複製代碼

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    int x,y;
  7.    cout<<"請輸入x的值:";
  8.    cin>>x;
  9.    cout<<"請輸入y的值:";
  10.    cin>>y;
  11.    cout<<"x="<<x<< endl;
  12.    cout<<"y="<<y<< 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 x,y;   
  7.     cout<<"請輸入x的值:";
  8.     cin>>x;
  9.     cout<<"請輸入y的值:";
  10.     cin>>y;
  11.     cout<<"x="<<x<<endl;
  12.     cout<<"y="<<y<<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 x,y;
  7.    
  8.     cout<<"請輸入X的值:";
  9.     cin>>x;
  10.     cout<<"請輸入Y的值:";
  11.     cin>>y;
  12.     cout<<"x+y-1234*2/567%x="<<x+y-1234*2/567%x<<endl;
  13.     system("pause");
  14.     return 0;
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.      int x,y;
  7.      cout<<"請輸入x的值:";
  8.      cin>>x;
  9.      cout<<"請輸入y的值:";
  10.      cin>>y;
  11.      cout<<"x="<<x<< endl;
  12.      cout<<"y="<<y<< 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 x,y;
  7.     cout<<"請輸入x的值:";
  8.     cin>>x;
  9.     cout<<"請輸入y的值:";
  10.     cin>>y;
  11.     cout<<"x="<<x<<endl;
  12.     cout<<"y="<<x<<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 x,y;
  7.     cout<<"請輸入x的值:";
  8.     cin>>x;
  9.     cout<<"請輸入y的值:";
  10.     cin>>y;
  11.     cout<<"x="<<x<<endl;
  12.     cout<<"y="<<y<<endl;  
  13.     system("pause");  
  14.     return 0;  
  15. }
複製代碼

TOP

返回列表