標題:
004_變數宣告與輸出
[打印本頁]
作者:
游東祥
時間:
2015-3-28 11:37
標題:
004_變數宣告與輸出
宣告變數a是整數型態、b浮點數、c字元、d字串
,內容自訂
接著輸出四個變數如下:
a = 55
b = 159.6
c = Z
d = Hello
複製代碼
作者:
林廷翰
時間:
2015-3-28 11:51
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a = 55;
float b =159.6;
char c = 'z';
string d = "hello";
cout << "a=" << a << endl;
cout << "b=" << b << endl;
cout << "c=" << c << endl;
cout << "d=" << d << endl;
system("pause");
return 0;
}
複製代碼
作者:
吳承勳
時間:
2015-3-28 11:51
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a =55;
float b =159.6;
char c = 'Z';
string d = "Hello";
cout << " a = " << a << endl;
cout << " b = " << b << endl;
cout << " c = " << c << endl;
cout << " d = " << d << endl;
system("pause");
return 0;
}
複製代碼
作者:
黃璽安
時間:
2015-3-28 11:52
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a = 55;
float b = 159.6;
char c = 'Z';
string d = "Hello";
cout << "a =" << a << endl;
cout << "b =" << b << endl;
cout << "c =" << c << endl;
cout << "d =" << d << endl;
system("pause");
return 0;
}
複製代碼
作者:
王翔
時間:
2015-4-10 20:49
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a = 55;
float b =159.6;
char c = 'z';
string d = "hello";
cout<<"a ="<<a<<endl;
cout<<"b ="<<b<<endl;
cout<<"c ="<<c<<endl;
cout<<"d ="<<d<<endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2