3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ひたすら標準入力を待ち続けたかった

Posted at

はじめに

普段解いている問題であれば、いくつ入力が来るか分かっているため、その数だけループを回せば良いはず。(例:http://abc008.contest.atcoder.jp/tasks/abc008_2
でも、もしそうでなかったらどうすれば良いのか分からなかった。
なのでちょっとやってみた。

作戦を考える

「とりあえずひたすら入力待ち状態にしよう」という案が出てきたので、書いてみた。
たぶんもっと良い方法があるため、ステキRubyistの皆様に教えて頂きたい所存である。

こんなコード書いた

stdin.rb
STDIN.each_line do |line|
	puts line
end

さいごに

たぶんもっと良い方法があるので、調べてみなければ。という感じです。

3
3
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?