2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

N行のデータ入力の読み取り

Posted at

C#で複数行の文字列を、通常1行しか取得しないConsole.ReadLineで受け取るには、ループを使います。

(条件)1行目で行数を表すNが与えられます。
次行は続いてN行分文字列が入力されます。

image.png
image.png

11行目でfor文にi < Nと書く時、ReadLineで受け取ったNは整数型に変換(int.Parse)をしないとエラーになります。

2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?