結果

問題 No.530 年齢って毎年変わるし覚えるの難しいよね
ユーザー wf4n9
提出日時 2017-10-12 12:42:39
言語 Java
(openjdk 23)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 366 bytes
コンパイル時間 2,151 ms
コンパイル使用メモリ 74,652 KB
実行使用メモリ 41,428 KB
最終ジャッジ日時 2024-11-17 10:47:58
合計ジャッジ時間 9,051 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 48
権限があれば一括ダウンロードができます

ソースコード

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