3
4

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.

C# Split int

Last updated at Posted at 2018-11-15

標準入力で、半角スペース区切りの数字の文字列を取得
例: 2 3 7 4

その数字の文字列を、int型に変換して、配列に降順で格納する

string line = System.Console.ReadLine();

int[] nums = line.Split(' ').Select(x => int.Parse(x)).OrderByDescending(x => x).ToArray();

3
4
2

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
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?