結果

問題 No.564 背の順
ユーザー cande398
提出日時 2017-10-07 13:02:44
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 393 bytes
コンパイル時間 2,514 ms
コンパイル使用メモリ 75,188 KB
実行使用メモリ 56,320 KB
最終ジャッジ日時 2024-11-17 04:25:27
合計ジャッジ時間 5,027 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
  public static void main(String[] args){
    int i, count = 1;
    String[] str = {"th", "st", "nd", "rd"};
    Scanner sc = new Scanner(System.in);
    int Nama = sc.nextInt();
    int num = sc.nextInt();
    for(i=0;i<num;i++){
      if(sc.nextInt()>Nama)count++;
    }
    System.out.printf("%d%s\n",count, (count%10<4)?str[count%10]:str[0]);
  }
}
0