標題:
自我介紹
[打印本頁]
作者:
陳育霖
時間:
2023-5-20 22:09
標題:
自我介紹
試宣告五個變數來裝你的個人資料, 分別為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;
}
複製代碼
作者:
王閎民
時間:
2023-5-25 20:59
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name = "王閎民",school = "小港國中";
int age=15;
float h=173.1, w=68.1;
cout<<"我的大名: "<<name<<endl;
cout<<"就讀: "<<school<<endl;
cout<<"今年: "<<age<<"歲"<<endl;
cout<<"身高: "<<h<<"cm"<<endl;
cout<<"體重: "<<w<<"kg"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
孟涵
時間:
2023-5-25 21:00
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="胡孟涵",school="明華國中";
int age=15;
float h=158.9 ,w=54.6;
cout<<"我的名字: "<<name<<endl;
cout<<"就讀: "<<school<<endl;
cout<<"今年: "<<age<<"歲"<<endl;
cout<<"身高: "<<h<<"身高"<<endl;
cout<<"體重: "<<w<<"公斤"<<endl;
system("pause");
return 0 ;
}
複製代碼
作者:
陳沁寧
時間:
2023-5-25 21:00
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
string name = "陳沁寧" , school = "復華國中";
int age = 13;
float h = 160.5 , w = 40.5;
cout << "我的名字:" << name << endl;
cout << "目前就讀:" << school << endl;
cout << "年紀:" << age << "歲" << endl;
cout << "身高:" << h << "公分" << endl;
cout << "體重:" << w << "公斤" << endl;
system("pause");
return 0;
}
複製代碼
作者:
李晨希
時間:
2023-5-25 21:07
#include<iostream>//標頭檔
#include<cstdlib>//標頭檔
using namespace std;
int main()
{
string name ="李晨希",school="愛國國小";
int age=15;
float h=160.1,w=50.5;
cout<<"我的大名:"<<name <<endl;
cout<<"就讀:"<<school<<endl;
cout<<"今年: "<<age<<" 歲"<<endl;
cout<<"身高: "<<h<<" 公分"<<endl;
cout<<"體重: "<<w<<" 公斤"<<endl;
system("pause");
return 0;
}
複製代碼
作者:
徐楷恩
時間:
2023-5-25 21:09
#include<iostream>//標頭檔
#include<cstdlib> //標頭檔
using namespace std;//使用命名空間
int main()
{
string name ="徐楷恩", school ="陽明國中" ;
int age =15;
float h =168.5, w =62.7;
cout <<"我的大名: "<<name<<endl;
cout <<"就讀: "<<school<<endl;
cout <<"今年: "<<age<<" 歲"<<endl;
cout <<"身高: "<<h<<" 公分"<<endl;
cout <<"體重: "<<w<<" 公斤"<<endl;
system ("pause");
return 0;
}
複製代碼
作者:
黃郁甯
時間:
2023-5-29 23:05
本帖最後由 黃郁甯 於 2023-5-30 19:04 編輯
#include<cstdlib>
using namespace std;
int main()
{
string name="黃郁甯",school=信義國小
int age=14;
float h=160.1,w=40.5;
coat<<"我的大名"<<name<<endl
coat<<"就讀"<<school<<endl;
coat<<"身高"<<h<<endl;
coat<<"體重"<<endl;
return0;
}
複製代碼
作者:
黃郁甯
時間:
2023-5-30 19:02
[code]#include<cstdlib>
using namespace std;
int main()
{
string name="黃郁甯",school=信義國小
int age=14;
float h=160.1,w=40.5;
coat<<"我的大名"<<name<<endl
coat<<"就讀"<<school<<endl;
coat<<"身高"<<h<<endl;
coat<<"體重"<<endl;
return0;
}
複製代碼
[/code]
回復
7#
黃郁甯
作者:
林家鉌
時間:
2023-5-30 20:23
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
float h=168.8,w=48.5;
string n="Louis.L",s="I-Show International School",c="9R";
cout<<"\nname:\t"<<n<<"\nschool:\t"<<s<<"\nclass:\t"<<c<<"\nheight:\t"<<h<<"\nweight\t"<<w<<"\n";
system("pause");
return 0;
}
複製代碼
作者:
陳品諺
時間:
2023-6-5 19:49
#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;
}
複製代碼
作者:
楊承樺
時間:
2023-6-8 13:51
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string name="楊承樺",school="五福國中";
int age=15;
float h=170.0,w=52.0;
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