結果
| 問題 | 
                            No.32 貯金箱の憂鬱
                             | 
                    
| コンテスト | |
| ユーザー | 
                             dogwood0424
                         | 
                    
| 提出日時 | 2017-11-28 13:48:25 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 146 ms / 5,000 ms | 
| コード長 | 1,005 bytes | 
| コンパイル時間 | 3,427 ms | 
| コンパイル使用メモリ | 74,984 KB | 
| 実行使用メモリ | 54,200 KB | 
| 最終ジャッジ日時 | 2024-07-23 06:48:04 | 
| 合計ジャッジ時間 | 5,830 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 12 | 
ソースコード
import java.util.Scanner;
public class No32 {
	public static void main(String[]args) {
		Scanner sc = new Scanner(System.in);
		int l,m,n;
		do {
			l=sc.nextInt();		//100円硬貨の初期枚数
			m=sc.nextInt();		//25円硬貨の初期枚数
			n=sc.nextInt();		//1円硬貨の初期枚数
		}while(!((0<=l && l<=1000)||(0<=m && m<=1000)||(0<=n && n<=1000)));
		int T=0;				//1000円紙幣の枚数
		int L=0;				//100円硬貨の枚数
		int M=0;				//25円硬貨の枚数
		int N=0;				//1円硬貨の枚数
		M = n/25;				//1円硬貨を25円硬貨へ両替
		n = n%25;				//残った1円硬貨の枚数
		M = M+m;				//両替後の25円硬貨の枚数
		L = M/4;				//25円硬貨を100円硬貨へ両替
		m = M%4;				//残った25円硬貨の枚数
		L = L+l;				//両替後の100円硬貨の枚数
		T = L/10;				//100円硬貨を1000円紙幣へ両替
		l = L%10;				//残った100円硬貨の枚数
		T = T;					//両替後の1000円紙幣の枚数
		System.out.println(n+m+l);
	}
}
            
            
            
        
            
dogwood0424