結果

問題 No.564 背の順
ユーザー cande398cande398
提出日時 2017-10-07 13:02:44
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 393 bytes
コンパイル時間 2,205 ms
コンパイル使用メモリ 75,724 KB
実行使用メモリ 41,700 KB
最終ジャッジ日時 2024-04-28 12:46:30
合計ジャッジ時間 4,641 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
権限があれば一括ダウンロードができます

ソースコード

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