學習所有程式語言的第一個練習題
請寫一個程式,可以讀入指定的字串,並且輸出指定的字串。
輸入說明 :指定的文字
輸出說明 :輸出指定的文字
範例輸入 :
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; }
Be First to Comment