結果

問題 No.530 年齢って毎年変わるし覚えるの難しいよね
ユーザー wf4n9wf4n9
提出日時 2017-10-12 12:42:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 366 bytes
コンパイル時間 2,364 ms
コンパイル使用メモリ 74,788 KB
実行使用メモリ 41,660 KB
最終ジャッジ日時 2024-04-28 17:02:25
合計ジャッジ時間 9,953 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
40,292 KB
testcase_01 AC 115 ms
40,120 KB
testcase_02 AC 131 ms
41,656 KB
testcase_03 AC 129 ms
41,660 KB
testcase_04 AC 128 ms
41,496 KB
testcase_05 AC 126 ms
41,108 KB
testcase_06 AC 127 ms
41,032 KB
testcase_07 AC 127 ms
41,220 KB
testcase_08 AC 126 ms
41,372 KB
testcase_09 AC 128 ms
41,176 KB
testcase_10 AC 127 ms
41,232 KB
testcase_11 AC 129 ms
40,972 KB
testcase_12 AC 129 ms
41,376 KB
testcase_13 AC 127 ms
41,180 KB
testcase_14 AC 128 ms
41,164 KB
testcase_15 AC 130 ms
41,280 KB
testcase_16 AC 131 ms
41,220 KB
testcase_17 AC 132 ms
41,256 KB
testcase_18 AC 130 ms
41,356 KB
testcase_19 AC 130 ms
41,380 KB
testcase_20 AC 128 ms
41,548 KB
testcase_21 AC 129 ms
41,108 KB
testcase_22 AC 131 ms
41,216 KB
testcase_23 AC 130 ms
41,504 KB
testcase_24 AC 129 ms
41,024 KB
testcase_25 AC 130 ms
41,404 KB
testcase_26 AC 114 ms
39,944 KB
testcase_27 AC 128 ms
41,304 KB
testcase_28 AC 127 ms
41,388 KB
testcase_29 AC 115 ms
40,064 KB
testcase_30 AC 130 ms
41,240 KB
testcase_31 AC 127 ms
41,244 KB
testcase_32 AC 129 ms
41,648 KB
testcase_33 AC 127 ms
41,052 KB
testcase_34 AC 114 ms
40,016 KB
testcase_35 AC 128 ms
41,132 KB
testcase_36 AC 130 ms
41,316 KB
testcase_37 AC 117 ms
41,132 KB
testcase_38 AC 132 ms
41,164 KB
testcase_39 AC 130 ms
41,208 KB
testcase_40 AC 129 ms
41,312 KB
testcase_41 AC 131 ms
41,144 KB
testcase_42 AC 130 ms
41,404 KB
testcase_43 AC 130 ms
41,124 KB
testcase_44 AC 130 ms
41,560 KB
testcase_45 AC 128 ms
41,276 KB
testcase_46 AC 130 ms
41,220 KB
testcase_47 AC 130 ms
41,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		String input = scn.nextLine();
		int birthYear = Integer.parseInt(input);
		int age = calcYear(birthYear);
		System.out.println(age);
	}

	public static int calcYear(int birthYear) {

		int age = 2017 - birthYear;

		return age;
	}
}
0