0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[paiza]レベルアップ問題集解答案(C#)【文字列の配列】辞書順に出力 Boss

Posted at

問題

C#解答案

using System;
using System.Linq;

class Program
{
    static void Main()
    {
        int[] num = Array.ConvertAll(Console.ReadLine().Split(' '),int.Parse);
        int N = num[0];
        int K = num[1];
        string[] list = Console.ReadLine().Split(' ');
        var list2 = list.OrderBy(x => x).ToArray();
        Console.WriteLine(list2[K-1]);
    }
}
0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?