返回列表 發帖

自我介紹

試宣告五個變數來裝你的個人資料, 分別為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="黃辰昊",school="陽明國小";
  7.     int age=11;
  8.     float h=140, w=0;
  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 =0,w=0;
  9.     cout<<"我的大名:"<<name<<endl;
  10.     cout<<"就讀:"<<school<<endl;
  11.     cout<<"今年:"<<age<<"歲"<<endl;
  12.     cout<<"身高"<<h<<"公分"<<endl;
  13.     cout<<"體重"<<w<<"公斤"<<endl;
  14.     cout<<"謝謝觀看"<<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=9;
  8.     float h=1000, w=35;
  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=12;
  8.     float h=171, 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<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name="董宸佑", school="博愛國小";
  7.     int age=12;
  8.     float h=154.7, w=49.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 n="林政瑜",s="三民國中(應該啦)",a="999+";
  7.     float h=94,w=87;
  8.     cout<<"傳說中的:"<<n<<endl;
  9.     cout<<"領地:"<<s<<endl;
  10.     cout<<"歲數:"<<a<<"歲"<<endl;
  11.     cout<<"高度:"<<h<<"公里"<<endl;
  12.     cout<<"在地球表面上所受的地心引力:"<<w<<"公噸"<<endl;
  13.    
  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=12;
  8.    float h=170;
  9.    
  10.    cout<<"我的大名: "<<name<<endl;
  11.    cout<<"就讀: "<<school<<endl;
  12.    cout<<"今年: "<<age<<" 歲"<<endl;
  13.    cout<<"身高: "<<h<<" 公分"<<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=163;
  9.    
  10.    cout<<"我的大名:"<<name<<endl;
  11.    cout<<"就讀:"<<school<<endl;
  12.    cout<<"今年:"<<age<<"歲"<<endl;
  13.    cout<<"身高:"<<h<<"公分"<<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=11;
  9.     float h=180, w=0.01;
  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="陳佑穎",schoooool="123";
  7.     int age=133;
  8.     float h=122.9, w=0.2;
  9.    
  10.     cout<<"名子: "<<name<<endl;   
  11.     cout<<"學校: : "<<schoooool<<endl;
  12.     cout<<"歲: : "<<age<<endl;
  13.     cout<<"身高: "<<h<<"公分"<<endl;
  14.     cout<<"體重: "<<w<<"公斤"endl;
  15.     system("pause");
  16.     return 0;
  17.      
  18. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name="黃宥華",school="加昌國小";
  7.     int age=11;
  8.     float h=146.8,w=1.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="周之閔",school="義大國際高中";
  7.     int age=16;
  8.     float h=172.2,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

返回列表