返回列表 發帖

自我介紹

試宣告五個變數來裝你的個人資料, 分別為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. }
複製代碼
Su Wa

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name="陳柏恩",school="右昌國中";
  7.     int age=16;
  8.     float h=169.8,w=78.6;
  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=168.8, w=50;
  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<stdio.h>
  2. #include<stdlib.h>
  3. using namespace std;
  4. int main(){
  5.     string name="邱玟瑜", school="高雄女中";
  6.     int age=16;
  7.     float h=165.0, w=49.3;
  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;
  15. }
複製代碼

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=166.2 w=55.6;
  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=9;
  8.     float h=138.6, w=27.5;
  9.     cout<<"我的大名:"<<"name"<<endl;
  10.     cout<<"就讀:"<<"school"<<endl;
  11.     cout<<"今年:"<<"歲"<<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=168.8, w=47.3;
  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;   
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string n="林秉軒",s="明華國中";
  7.     int a=15;
  8.     float w=51.0,h=169.9;
  9.     cout<<"我的大名"<<n<<endl;
  10.     cout<<"就讀"<<s<<endl;
  11.     cout<<"今年"<<a<<"歲"<<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=168.8,w=60.7;
  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=173, w=60;
  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

返回列表