#9322: a001 哈囉 C++ TLE


boy330077 (unknown)


#include <iostream>
using namespace std;

int main() {
    string s;
    while(1){
    cin >> s;
        cout << "hello, "<< s << endl;
    }
    return 0;
}
 
DEV C++ 正常執行
 
但是放上來卻  TLE  請高手指點問題 
 
#9327: Re:a001 哈囉 C++ TLE


anandrewboy70900 (ShowTsai)


#include <iostream>
using namespace std;

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


#9543: Re:a001 哈囉 C++ TLE


lsyyw2002 (袁祎炜)


#include
using namespace std;

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


 

你自己看a001的模本啊;有答案的

 

 

#9545: Re:a001 哈囉 C++ TLE


a23248630 (BensonYee)


#include
using namespace std;

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

while(1)會造成無限循環