結果
| 問題 | No.32 貯金箱の憂鬱 | 
| コンテスト | |
| ユーザー |  dnish | 
| 提出日時 | 2016-12-21 10:41:43 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 313 bytes | 
| コンパイル時間 | 123 ms | 
| コンパイル使用メモリ | 22,784 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-23 02:27:28 | 
| 合計ジャッジ時間 | 663 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 12 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d",&hyaku);
      |         ~~~~~^~~~~~~~~~~~~
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d",&nijyugo);
      |         ~~~~~^~~~~~~~~~~~~~~
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%d",&ichi);
      |         ~~~~~^~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
int main(void) {
	int hyaku,nijyugo,ichi;
	
	scanf("%d",&hyaku);
	scanf("%d",&nijyugo);
	scanf("%d",&ichi);
	
	while(ichi>=25){
		nijyugo++;
		ichi -=25;
	}
	while(nijyugo>=4){
		hyaku++;
		nijyugo -=4;
	}
	while(hyaku>=10){
		hyaku -=10;
	}
	printf("%d\n",ichi+nijyugo+hyaku);
	
	return 0;
}
            
            
            
        