In the loop, I read a line of input.
The method std::getline(std::cin, line); reads until a newline, right?
Then I branch according to the last character of the line of input.
When the last character is an exclamation mark, I simply terminate the program.
When the last character is a question mark, I need to print "Quack!" right?
In any other case, I simply print "*Nod*".
Wait, to flush the output stream I need to use std::endl instead of '\n' right?
I quacked the code!
위 input data를 밑의 input data로 수정해주세요
input 데이터에 각 line 마다 빈 줄이 뒤에 추가되어 있는데 이처럼 한출 입력받고 빈줄을 입력 받는 코드 제출시 시간초과가 뜹니다. output 또한 앞과 뒤에 빈 줄이 있는데 BAPC에서 제공하는 output과는 다른 것 같습니다.
In the loop, I read a line of input.
The method std::getline(std::cin, line); reads until a newline, right?
Then I branch according to the last character of the line of input.
When the last character is an exclamation mark, I simply terminate the program.
When the last character is a question mark, I need to print "Quack!" right?
In any other case, I simply print "*Nod*".
Wait, to flush the output stream I need to use std::endl instead of '\n' right?
I quacked the code!
jaeseb96 3년 전
위 input data를 밑의 input data로 수정해주세요
input 데이터에 각 line 마다 빈 줄이 뒤에 추가되어 있는데 이처럼 한출 입력받고 빈줄을 입력 받는 코드 제출시 시간초과가 뜹니다. output 또한 앞과 뒤에 빈 줄이 있는데 BAPC에서 제공하는 output과는 다른 것 같습니다.
혹시 대화형 input, output을 의도하시고 한건가요?