標題:
自我介紹
[打印本頁]
作者:
tonyh
時間:
2016-5-19 11:15
標題:
自我介紹
本帖最後由 tonyh 於 2016-5-19 12:19 編輯
試宣告五個變數來裝你的個人資料, 分別為2個字串(string)變數, 1個整數(int)變數, 2個浮點數(float)變數, 完成如下的執行畫面:
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="黃國穎", school="愛國國小";
int age=9;
float h=138.6, w=27.5;
cout<<"我的大名: "<<name<<endl;
cout<<"就讀: "<<school<<endl;
cout<<"今年: "<<age<<" 歲"<<endl;
cout<<"身高: "<<h<<" 公分"<<endl;
cout<<"體重: "<<w<<" 公斤"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
謝易錚
時間:
2016-5-19 11:47
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="謝易錚";
string school="明華國中";
int age=15;
float h=175;
float w=82;
cout<<"名字"<<name<<endl;
cout<<"就讀"<<school<<endl;
cout<<"年齡"<<age<<"歲"<<endl;
cout<<"身高"<<h<<"cm"<<endl;
cout<<"體重"<<w<<"kg"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
邱士杰
時間:
2016-5-19 11:50
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="邱士杰",school="五福國中";
int age=15;
float h=177,w=55;
cout<<"我的大名:"<<name<<endl;
cout<<"就讀:"<<school<<endl;
cout<<"今年:"<<age<<"歲"<<endl;
cout<<"身高:"<<h<<"cm"<<endl;
cout<<"體重:"<<w<<"kg"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
徐琬淇
時間:
2016-5-19 11:50
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="徐琬淇";
string school="濱江國中";
int age=15;
float h=161;
float w=55;
cout<<"我的名字:"<<name<<endl;
cout<<"就讀學校:"<<school<<endl;
cout<<"今年年齡:"<<age<<"歲"<<endl;
cout<<"身高:"<<h<<"公分"<<endl;
cout<<"體重:"<<w<<"公斤"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
劉得榮
時間:
2016-5-19 11:52
#include<iostream>
#include<cstdlib>
using namespace std;
int main ()
{
string name="劉得榮",school="大社國中";
int age=15;
float h=172.9, w=52.9;
cout<<"我的大名:"<<name<<endl;
cout<<"就讀:"<<school<<endl;
cout<<"今年:"<<age<<endl;
cout<<"身高:"<<h<<endl;
cout<<"體重:"<<w<<endl;
system("pause");
return 0;
}
複製代碼
作者:
蔡孟庭
時間:
2016-5-19 11:52
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="蔡孟庭",school="三民國中";
int age=15;
float h=160.5,w=55.5 ;
cout<<"我的大名: "<<name<<endl;
cout<<"就讀: "<<school<<endl;
cout<<"今年: "<<age<<"歲"<<endl;
cout<<"身高: "<<h<<"公分"<<endl;
cout<<"體重: "<<w<<"公斤"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
謝旻錡
時間:
2016-5-19 11:54
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="謝旻錡";
string school="五福國中";
int age=15;
float h=171,w=57;
cout<<"大名:"<<name<<endl;
cout<<"就讀:"<<school<<endl;
cout<<"年齡:"<<age<<"歲"<<endl;
cout<<"身高:"<<h<<"cm"<<endl;
cout<<"體重:"<<w<<"kg"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
孫漢瑄
時間:
2016-5-19 11:55
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="孫漢瑄",school="五福國中";
int age=14;
float h=164,w=49;
cout<<"我的大名:"<<name<<endl;
cout<<"就讀"<<school<<endl;
cout<<"今年"<<age<<"歲"<<endl;
cout<<"身高"<<h<<"公分"<<endl;
cout<<"體重"<<w<<"公斤"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
洪為濬
時間:
2016-5-19 11:55
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="洪為濬",school="五福國中";
int age=15;
float h=175,w=55;
cout<<"我的名字:"<<name<<endl;
cout<<"就讀於:"<<school<<endl;
cout<<"年齡:"<<age<<"歲"<<endl;
cout<<"身高:"<<h<<"公分"<<endl;
cout<<"體重:"<<w<<"公斤"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
邱柏揚
時間:
2016-5-19 11:55
本帖最後由 邱柏揚 於 2016-5-19 12:04 編輯
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="邱柏揚";
string school="福山國中";
int age=15;
float h=168.7;
float w=55.2;
cout<<"名字:"<<name<<endl;
cout<<"學校:"<<school<<endl;
cout<<"今年:"<<age<<"歲"<<endl;
cout<<"身高:"<<h<<"公分"<<endl;
cout<<"體重:"<<w<<"公斤"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
張恩嘉
時間:
2016-5-19 11:57
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="張恩嘉" ,school="五福國中" ;
int age=1000;
float h=180.0;
float w=55.5;
cout<<"我的大名:"<< name<<endl;
cout<<"就讀:"<<school<<endl;
cout<<"今年:"<<age<<"歲"<<endl;
cout<<"身高:"<<h<< "公分"<<endl;
cout<<"體重:"<<w<< "公斤"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
王淳暘
時間:
2016-5-19 11:58
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="王淳暘",school="五福國中";
int age=184;
float h=0.001665 ;
float w=0.0425;
cout<<"我的大名:"<<name<<endl;
cout<<"就讀:"<<school<<endl;
cout<<"今年:"<<age<<"個月"<<endl;
cout<<"身高:"<<h<<"公里"<<endl;
cout<<"體重:"<<w<<"公噸"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
林禹彤
時間:
2016-5-19 12:01
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="Albus Percival Wulfric Brian Dumbledore",school="Hogwarts School of Witchcraft and Wizardry";
int age=116;
float h=000,w=000;
cout<<"名字: "<<name<<endl;
cout<<"學校: "<<school<<endl;
cout<<"年齡: "<<age<<endl;
cout<<"身高: "<<h<<endl;
cout<<"體重: "<<w<<endl<<endl<<endl<<endl;
system("pause");
return 0;
}
複製代碼
作者:
劉瑑恩
時間:
2016-5-19 12:04
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="劉瑑恩",school="五福國中";
int age=15;
float h=174,w=58;
cout<<"我的大名:"<<name<<endl;
cout<<"就讀:"<<school<<endl;
cout<<"今年:"<<age<<endl;
cout<<"身高:"<<h<<"公分"<<endl;
cout<<"體重:"<<w<<"公斤"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
蔡孟君
時間:
2016-5-19 12:05
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="蔡孟君";
string school="五福國中";
int age=15;
float h=165;
float w=55;
cout<<"我的大名:"<<name<<endl;
cout<<"就讀:"<<school<<endl;
cout<<"今年: "<<age<<"歲"<<endl;
cout<<"身高:"<<h<<"公分"<<endl;
cout<<"體重:"<<w<<"公斤"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
劉純妘
時間:
2016-5-19 12:19
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="劉純妘" ,school="道明中學";
int age=15;
float h=170.9,w=48;
cout<<"我的大名:"<<name<<endl;
cout<<"就讀:"<<school<<endl;
cout<<"今年:"<<age<<"歲"<<endl;
cout<<"身高:"<<h<<"公分"<<endl;
cout<<"體重:"<<w<<"公斤"<<endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2