回答編集履歴
2
質問が変更されたので削除
answer
CHANGED
@@ -1,22 +1,1 @@
|
|
1
|
-
タグにCとC++とあるので、CなのかC++なのか両方なのか競技プログラムで使うのかなどで変わりますがC++の場合の一例です。
|
2
|
-
|
3
|
-
参考:
|
4
|
-
[【就プロ】C++標準入出力](http://takahiro-itazuri.hatenadiary.jp/entry/2017/12/31/020759)
|
5
|
-
[標準入力から安全に文字列を受け取る方法いろいろ](https://qiita.com/mpyw/items/aff12a6ff2c7726ed1d8)
|
6
|
-
|
7
|
-
```C++
|
8
|
-
#include <iostream>
|
9
|
-
#include <cstdio>
|
10
|
-
#include <string>
|
11
|
-
|
12
|
-
// "EOF=Windows10ならF6キー→Enterキーで終了"
|
13
|
-
int main() {
|
14
|
-
|
1
|
+
質問が変更されたので削除します。
|
15
|
-
while (!std::cin.eof()) {
|
16
|
-
std::getline(std::cin, line);
|
17
|
-
}
|
18
|
-
std::cout << line << std::endl;
|
19
|
-
getchar();
|
20
|
-
return 0;
|
21
|
-
}
|
22
|
-
```
|
1
#include修正
answer
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
```C++
|
8
8
|
#include <iostream>
|
9
|
-
#include <
|
9
|
+
#include <cstdio>
|
10
10
|
#include <string>
|
11
11
|
|
12
12
|
// "EOF=Windows10ならF6キー→Enterキーで終了"
|