返回列表 發帖

基本輸入與輸出

  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int x, y;    //宣告整數變數, 分別命名為x與y
  6.     cout<<"請輸入x的值: ";
  7.     cin>>x;
  8.     cout<<"請輸入y的值: ";
  9.     cin>>y;
  10.     cout<<"您剛輸入的x值為"<<x<<", y值為"<<y<<endl;
  11.     system("pause");
  12.     return 0;   
  13. }
複製代碼

返回列表