結果

問題 No.542 1円玉と5円玉
ユーザー aaaaasatori
提出日時 2018-02-14 08:55:49
言語 Java
(openjdk 23)
結果
AC  
実行時間 159 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 3,493 ms
コンパイル使用メモリ 74,792 KB
実行使用メモリ 54,360 KB
最終ジャッジ日時 2024-12-17 23:49:51
合計ジャッジ時間 6,246 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No542 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(); //1円玉の枚数
		int B = sc.nextInt(); //5円玉の枚数
		
		for(int i = 0;i <= B;i++) {
			for(int j = 0;j <= A;j++) {
				if(i != B && j == 5) {
					break;
				}else {
					if(i + j != 0) {
						System.out.println(j  + i * 5);
					}
				}
			}
		}
	}
}
0