#1383: how to AC


1652274-5@g.puiching.edu.mo (P6A05何承禧)

School : No School
ID : 2934
IP address : [192.168.120.33]
Last Login :
2024-10-04 15:25:27
a001. 哈囉 -- Brian Kernighan | From: [192.168.120.33] | Post Date : 2024-02-04 14:43

For some reason, zero1 won't let us use "cout << "hello, " << s;", so we have to use a while loop.

 

#include <iostream>

using namespace std;

 

int main() {

    string s;

     while(cin >> s){

         cout << "hello, "<< s << endl;

     }

     return 0;

 
#1411: Re:how to AC


1652371-7@g.puiching.edu.mo (P6A20張子睿)

School : No School
ID : 2932
IP address : [192.168.120.33]
Last Login :
2024-07-01 09:55:48
a001. 哈囉 -- Brian Kernighan | From: [192.168.120.33] | Post Date : 2024-03-05 13:04

For some reason, zero1 won't let us use "cout << "hello, " << s;", so we have to use a while loop.

 

#include

using namespace std;

 

int main() {

    string s;

     while(cin >> s){

         cout << "hello, "<< s << endl;

     


I know why:

From zero 1 puiching:程式說明:因為系統會賦予數量不一的測試資料來測驗您的程式是否正確,因此必須先以一個 while 迴圈來讀取所有的測試資料。

 
ZeroJudge Forum