返回列表 發帖

基本輸入輸出

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a;   //int ---> integer  整數
  7.     cout<<"請輸入一整數: ";
  8.     cin>>a;
  9.     cout<<"你剛輸入的數字是: "<<a<<endl;
  10.     system("pause");
  11.     return 0;   
  12. }
複製代碼

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()//主方法
  5. {
  6.     int a;//int---->integer 整數 空盒子 取一個名叫做a
  7.     cout<<"請輸入一整數: "; //文字
  8.     cin>>a;//要輸入字並且存在a這個盒子
  9.     cout<<"你剛輸入的數字是:"<<a<<endl;
  10.     system("pause");//先做暫停
  11.     return 0;
  12.    
  13. }


  14. // 單行註解

  15. /*
  16. segjoisejgoesjglmgejej




  17. */
複製代碼

TOP

返回列表