Skip to content

[ACM] a001: 哈囉

學習所有程式語言的第一個練習題
請寫一個程式,可以讀入指定的字串,並且輸出指定的字串。

輸入說明 :指定的文字

輸出說明 :輸出指定的文字

範例輸入 :

world
C++
mary

範例輸出 :

hello, world
hello, C++
hello, mary

出處:http://zerojudge.tw/ShowProblem?problemid=a001

程式碼:

#include
using namespace std;
int main()
{
	string s;
	while (cin>>s)
	{
		cout<<"hello, "<<s<<endl;
	}
	return 0;
}
Published inACM解題

Be First to Comment

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *