返回列表 發帖
  1. #include<iostream>     //引入 <基本輸入輸出> 標頭檔 input & output stream
  2. #include<cstdlib>      //引入 <標準函式庫> 標頭檔 c standard library
  3. using namespace std;   //指定命名空間為 std

  4. int main()    //主函式
  5. { string name="朱閎聿", school="明華國中";  //名字和學校是字串
  6.     int age=12;   // 12是整數
  7.     float h=152.9f, w=53.5f;  //身高和體重都有小數點
  8.     cout<<"我的大名:"<<name<<endl;
  9.     cout<<"就讀:"<<school<<endl;
  10.     cout<<"今年:"<<age<<"歲"<<endl;
  11.     cout<<"身高:"<<h<<"公分"<<endl;
  12.     cout<<"體重:"<<w<<"公斤"<<endl;
  13.     system("pause");       //讓畫面暫停
  14.     return 0;              //回傳0到主控台,告知該程式已成功執行
  15. }
複製代碼

TOP

返回列表