返回列表 發帖

基本輸入輸出 (一)

  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. }
複製代碼
Su Wa

  1. #include<iostream> //輸入輸出功能  工具箱1
  2. #include<cstdlib> //標準函式庫     工具箱2
  3. using namespace std; //叫做std的房間
  4. int main()//主函式
  5. {
  6.     int a;
  7.     cout<<"請輸入一整數:";
  8.     cin>>a;
  9.     cout<<"您輸入的數字是"<<a<<endl;
  10.     system("pause");//暫停畫面
  11.     return 0;//回傳0
  12. } //ctrl+A 全選   +C複製  +V貼上
複製代碼
Su Wa

TOP

返回列表