標題:
自我介紹
[打印本頁]
作者:
tonyh
時間:
2016-3-5 11:06
標題:
自我介紹
本帖最後由 tonyh 於 2016-3-5 11:32 編輯
試宣告五個變數來裝你的個人資料, 分別為2個字串(string)變數, 1個整數(int)變數, 2個浮點數(float)變數, 完成如下的執行畫面:
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="黃國穎",school="愛國國小";
int age=9;
float h=1.38,w=27.5;
cout<<"我的大名: "<<name<<endl;
cout<<"就讀: "<<school<<endl;
cout<<"今年: "<<age<<" 歲"<<endl;
cout<<"身高: "<<h<<" 公分"<<endl;
cout<<"體重: "<<w<<" 公斤"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
陸長辰
時間:
2016-3-5 11:28
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="陸長辰",school="英明國中";
int age=13;
float h=166,w=30;
cout<<"我的大名:"<<name<<endl;
cout<<"就讀:"<<school<<endl;
cout<<"今年:"<<age<<" 歲"<<endl;
cout<<"身高:"<<h<<" 公分"<<endl;
cout<<"體重:"<<w<<" 公斤"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
方宥鈞
時間:
2016-3-5 11:28
#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<<"cm"<<endl;
cout<<"體重:"<<w<<"kg"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
陳泓瑜
時間:
2016-3-5 11:32
#include<iostream>
#include<cstdlib>
using namespace std;
int main ()
{
string name="陳泓瑜",school="文山國小";
int age=11;
float high=151.4,weight=39.2;
cout<<"姓名: "<<name<<endl;
cout<<"就讀: "<<school<<endl;
cout<<"年齡: "<<age<<" 歲"<<endl;
cout<<"身高: "<<high<<" CM"<<endl;
cout<<"體重: "<<weight<<" KG"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
高允懋
時間:
2016-3-5 14:27
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="高允懋";
string school="龍華國中";
int age=12;
float high=153.5;
float weight=36.5;
cout<<"我的大名: "<<name<<endl;
cout<<"就讀: "<<school<<endl;
cout<<"今年: "<<age<<" 歲"<<endl;
cout<<"身高: "<<high<<" 公分"<<endl;
cout<<"體重: "<<weight<<" 公斤"<<endl;
system("pause");
return 0 ;
}
複製代碼
作者:
黃茂勛
時間:
2016-3-5 14:28
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="黃茂勛",school="英明國中";
int age=12;
float h=168.5,w=53.2;
cout<<"我的大名: "<<name<<endl;
cout<<"就讀: "<<school<<endl;
cout<<"今年: "<<age<<" 歲"<<endl;
cout<<"身高: "<<h<<" 公分"<<endl;
cout<<"體重: "<<w<<" 公斤"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
任立宇
時間:
2016-3-5 14:29
#include<iostream>
#include<cstdlib>
using namespace std;
int main;
{
string name ="任立宇"
strung school ="勝利國小"
int age = 9;
float h=154,w=47
cout<<"我的名"<<"<<name<<endl;
cout<<"讀"<<"<<school<<endl;
cout<<"今年"<<"<<<<endl;
cout<<"身高"<<"<<公分<<endl;
cout<<"體重"<<"<<公斤<<endl;
syatam()
return 0;
}
複製代碼
作者:
張孟軒
時間:
2016-3-12 10:11
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="張孟軒",school="明華國中";
int age=14;
float h=1.80,w=54;
cout<<"我的大名"<<name<<endl;
cout<<"就讀"<<school<<endl;
cout<<"今年"<<age<<" 歲"<<endl;
cout<<"身高"<<h<<"公分"<<endl;
cout<<"體重"<<w<<"公斤"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
康湍榆
時間:
2016-3-12 15:49
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="康湍榆",school="四維國小";
int age=10;
float h=153.8,w=45.22;
cout<<"大名: "<<name<<endl;
cout<<"就讀: "<<school<<endl;
cout<<"年紀: "<<age<<" 歲"<<endl;
cout<<"身高: "<<h<<" 公分"<<endl;
cout<<"大名: "<<w<<" 公斤"<<endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2