#7128: __不懂


arashi (嵐泰)


不懂什麼是

以一个while 回圈来读取所有的测试资料

#7175: Re:不懂


akira0331 (小迷糊)


不懂什麼是

以一个while 回圈来读取所有的测试资料

C 解題範例
#include<stdio.h>
int main() {
    char s[9999];
    while( scanf("%s",s)!=EOF ) {
        printf("hello, %s\n",s);
    }
    return 0;
}

 C++ 解題範例

#include <iostream>
using namespace std;

int main() {
    string s;
    while(cin >> s){
        cout << "hello, "<< s << endl;
    }
    return 0;
}

用一個while可以重覆讀取input