結果

問題 No.32 貯金箱の憂鬱
ユーザー yj1145141919yj1145141919
提出日時 2016-07-08 11:18:52
言語 C90
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 680 bytes
コンパイル時間 926 ms
コンパイル使用メモリ 24,092 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-30 07:42:37
合計ジャッジ時間 1,961 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 0 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 0 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

/*
 * chokin.c
 *
 *  Created on: 2016/07/08
 *      Author: admin
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
	int hyaku=0;
	int nijugo=0;
	int ichi=0;
	int satsu=0;
	int sum=0;
	char str[1000];

	//100円硬貨
	fgets(str, sizeof(str), stdin);
	hyaku = atoi(str);

	//25円硬貨
	fgets(str, sizeof(str), stdin);
	nijugo = atoi(str);

	//1円硬貨
	fgets(str, sizeof(str), stdin);
	ichi = atoi(str);

	if(ichi > 25){
		nijugo += ichi / 25;
		ichi = ichi % 25;
	}

	if(nijugo > 4){
		hyaku += nijugo / 4;
		nijugo = nijugo % 4;
	}

	if(hyaku > 10){
		hyaku = hyaku % 10;
	}

	sum = hyaku + nijugo + ichi;
	printf("%d\n", sum);

	return 0;
}

0