結果
| 問題 | No.32 貯金箱の憂鬱 | 
| コンテスト | |
| ユーザー |  aparachia14 | 
| 提出日時 | 2015-12-23 16:26:15 | 
| 言語 | C90 (gcc 12.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 752 bytes | 
| コンパイル時間 | 249 ms | 
| コンパイル使用メモリ | 20,608 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-23 02:12:56 | 
| 合計ジャッジ時間 | 716 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 12 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 | scanf("%d",&hun);
      | ^~~~~~~~~~~~~~~~
main.c:9:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 | scanf("%d",&qut);
      | ^~~~~~~~~~~~~~~~
main.c:10:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 | scanf("%d",&one);
      | ^~~~~~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
int main(void){
//硬貨の枚数を格納する変数を宣言
int hun,qut,one;
//入力待ち
scanf("%d",&hun);
scanf("%d",&qut);
scanf("%d",&one);
//1円硬貨を25円硬貨に両替する。
int oneTOqut = (one / 25);
//余りを求める
int oneRem = (one % 25);
//oneRemをoneに代入
one = oneRem;
//oneTOqutをqutに加算
qut += oneTOqut;
//25円硬貨を100円硬貨に両替する。
int qutTOhun = ((qut*25)/100);
//余りを求める
int qutRem = ((qut*25) % 100)/25;
//qutRemをqutに代入
qut = qutRem;
//qutTOhunをhunに加算
hun += qutTOhun;
//余りを求める
int hunRem = ((hun*100) % 1000)/100;
//hunRemをhunに代入
hun = hunRem;
int sum = one + qut + hun;
printf("%d",sum);
return 0;
}
            
            
            
        