返回列表 發帖

自我介紹

本帖最後由 tonyh 於 2016-5-19 12:19 編輯

試宣告五個變數來裝你的個人資料, 分別為2個字串(string)變數, 1個整數(int)變數, 2個浮點數(float)變數, 完成如下的執行畫面:

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name="黃國穎", school="愛國國小";
  7.     int age=9;
  8.     float h=138.6, w=27.5;
  9.     cout<<"我的大名: "<<name<<endl;
  10.     cout<<"就讀: "<<school<<endl;
  11.     cout<<"今年: "<<age<<" 歲"<<endl;
  12.     cout<<"身高: "<<h<<" 公分"<<endl;
  13.     cout<<"體重: "<<w<<" 公斤"<<endl;
  14.     system("pause");
  15.     return 0;   
  16. }
複製代碼

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name="謝易錚";
  7.     string school="明華國中";
  8.     int age=15;
  9.     float h=175;
  10.     float w=82;
  11.     cout<<"名字"<<name<<endl;
  12.     cout<<"就讀"<<school<<endl;
  13.     cout<<"年齡"<<age<<"歲"<<endl;
  14.     cout<<"身高"<<h<<"cm"<<endl;
  15.     cout<<"體重"<<w<<"kg"<<endl;
  16.     system("pause");
  17.     return 0;
  18. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    string name="邱士杰",school="五福國中";
  7.    int age=15;
  8.    float h=177,w=55;
  9.    cout<<"我的大名:"<<name<<endl;
  10.    cout<<"就讀:"<<school<<endl;
  11.    cout<<"今年:"<<age<<"歲"<<endl;
  12.    cout<<"身高:"<<h<<"cm"<<endl;
  13.    cout<<"體重:"<<w<<"kg"<<endl;
  14.    system("pause");
  15.    return 0;
  16. }  
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name="徐琬淇";
  7.     string school="濱江國中";
  8.     int age=15;
  9.     float h=161;
  10.     float w=55;
  11.     cout<<"我的名字:"<<name<<endl;
  12.     cout<<"就讀學校:"<<school<<endl;
  13.     cout<<"今年年齡:"<<age<<"歲"<<endl;
  14.     cout<<"身高:"<<h<<"公分"<<endl;
  15.     cout<<"體重:"<<w<<"公斤"<<endl;
  16.     system("pause");
  17.     return 0;
  18. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main ()
  5. {
  6.    string name="劉得榮",school="大社國中";
  7.    int age=15;
  8.    float h=172.9, w=52.9;
  9.    cout<<"我的大名:"<<name<<endl;
  10.    cout<<"就讀:"<<school<<endl;
  11.    cout<<"今年:"<<age<<endl;
  12.    cout<<"身高:"<<h<<endl;
  13.    cout<<"體重:"<<w<<endl;
  14.     system("pause");
  15.     return 0;
  16. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name="蔡孟庭",school="三民國中";
  7.     int age=15;
  8.     float h=160.5,w=55.5 ;
  9.     cout<<"我的大名: "<<name<<endl;
  10.     cout<<"就讀: "<<school<<endl;
  11.     cout<<"今年: "<<age<<"歲"<<endl;
  12.     cout<<"身高: "<<h<<"公分"<<endl;
  13.     cout<<"體重: "<<w<<"公斤"<<endl;
  14.     system("pause");
  15.     return 0;
  16. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name="謝旻錡";
  7.     string school="五福國中";
  8.     int age=15;
  9.     float h=171,w=57;
  10.         cout<<"大名:"<<name<<endl;
  11.         cout<<"就讀:"<<school<<endl;
  12.         cout<<"年齡:"<<age<<"歲"<<endl;
  13.         cout<<"身高:"<<h<<"cm"<<endl;
  14.         cout<<"體重:"<<w<<"kg"<<endl;
  15.    
  16.       system("pause");
  17.       return 0;
  18. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name="孫漢瑄",school="五福國中";
  7.     int age=14;
  8.     float h=164,w=49;
  9.     cout<<"我的大名:"<<name<<endl;
  10.     cout<<"就讀"<<school<<endl;
  11.     cout<<"今年"<<age<<"歲"<<endl;
  12.     cout<<"身高"<<h<<"公分"<<endl;
  13.     cout<<"體重"<<w<<"公斤"<<endl;
  14.     system("pause");
  15.     return 0;     
  16. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name="洪為濬",school="五福國中";
  7.     int age=15;
  8.     float h=175,w=55;
  9.     cout<<"我的名字:"<<name<<endl;
  10.     cout<<"就讀於:"<<school<<endl;  
  11.     cout<<"年齡:"<<age<<"歲"<<endl;
  12.     cout<<"身高:"<<h<<"公分"<<endl;
  13.     cout<<"體重:"<<w<<"公斤"<<endl;
  14.     system("pause");
  15.     return 0;  
  16. }
複製代碼

TOP

本帖最後由 邱柏揚 於 2016-5-19 12:04 編輯
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.      string name="邱柏揚";
  7.      string school="福山國中";
  8.      int age=15;
  9.      float h=168.7;
  10.      float w=55.2;
  11.      cout<<"名字:"<<name<<endl;
  12.      cout<<"學校:"<<school<<endl;
  13.      cout<<"今年:"<<age<<"歲"<<endl;
  14.      cout<<"身高:"<<h<<"公分"<<endl;
  15.      cout<<"體重:"<<w<<"公斤"<<endl;
  16.      system("pause");
  17.      return 0;
  18. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.       string name="張恩嘉" ,school="五福國中" ;
  7.       int age=1000;
  8.       float h=180.0;
  9.       float w=55.5;
  10.       cout<<"我的大名:"<< name<<endl;
  11.       cout<<"就讀:"<<school<<endl;
  12.       cout<<"今年:"<<age<<"歲"<<endl;
  13.       cout<<"身高:"<<h<< "公分"<<endl;
  14.       cout<<"體重:"<<w<< "公斤"<<endl;
  15.       system("pause");
  16.       return 0;
  17. }      
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int  main()
  5. {
  6.    string name="王淳暘",school="五福國中";
  7.    int age=184;
  8.    float h=0.001665 ;
  9.    float w=0.0425;
  10.    cout<<"我的大名:"<<name<<endl;
  11.    cout<<"就讀:"<<school<<endl;
  12.    cout<<"今年:"<<age<<"個月"<<endl;
  13.    cout<<"身高:"<<h<<"公里"<<endl;
  14.    cout<<"體重:"<<w<<"公噸"<<endl;
  15.     system("pause");
  16.     return 0;
  17. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name="Albus Percival Wulfric Brian Dumbledore",school="Hogwarts School of Witchcraft and Wizardry";
  7.     int age=116;
  8.     float h=000,w=000;
  9.     cout<<"名字: "<<name<<endl;
  10.     cout<<"學校: "<<school<<endl;
  11.     cout<<"年齡: "<<age<<endl;
  12.     cout<<"身高: "<<h<<endl;
  13.     cout<<"體重: "<<w<<endl<<endl<<endl<<endl;
  14.     system("pause");
  15.     return 0;
  16. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name="劉瑑恩",school="五福國中";
  7.     int age=15;
  8.     float h=174,w=58;
  9.     cout<<"我的大名:"<<name<<endl;
  10.     cout<<"就讀:"<<school<<endl;
  11.     cout<<"今年:"<<age<<endl;
  12.     cout<<"身高:"<<h<<"公分"<<endl;
  13.     cout<<"體重:"<<w<<"公斤"<<endl;
  14.     system("pause");
  15.     return 0;
  16. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {   
  6.      string name="蔡孟君";
  7.      string school="五福國中";
  8.      int age=15;
  9.      float h=165;
  10.      float w=55;
  11.      cout<<"我的大名:"<<name<<endl;
  12.      cout<<"就讀:"<<school<<endl;
  13.      cout<<"今年: "<<age<<"歲"<<endl;
  14.      cout<<"身高:"<<h<<"公分"<<endl;
  15.      cout<<"體重:"<<w<<"公斤"<<endl;
  16.      system("pause");
  17.      return 0;
  18. }     
複製代碼

TOP

  1. #include<iostream>  
  2. #include<cstdlib>  
  3. using namespace std;
  4. int main()
  5. {
  6.       string name="劉純妘" ,school="道明中學";
  7.       int age=15;
  8.       float h=170.9,w=48;
  9.       cout<<"我的大名:"<<name<<endl;
  10.       cout<<"就讀:"<<school<<endl;
  11.       cout<<"今年:"<<age<<"歲"<<endl;
  12.       cout<<"身高:"<<h<<"公分"<<endl;
  13.       cout<<"體重:"<<w<<"公斤"<<endl;
  14.       system("pause");
  15.       return 0;
  16. }
複製代碼

TOP

返回列表