結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー aaaa3215aaaa3215
提出日時 2018-03-30 15:38:28
言語 C
(gcc 12.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 526 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 29,640 KB
実行使用メモリ 8,752 KB
最終ジャッジ日時 2023-09-11 04:35:37
合計ジャッジ時間 2,713 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,752 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<math.h>
#define NUM 5

int func(int n) {
	int a = pow(10, n);
	return a;
	}

int main(void) {
	int a[NUM];
	int sum = 0;
	int i;
	int j = 0;

	for (i = 0; i < NUM; i++) {
		scanf("%d", &a[i]);

		if ((a[i] % 5 == 0) && (a[i] % 3 == 0)) {
			sum += 8;
		}

		else if ((a[i] % 5 != 0)&&(a[i] % 3 != 0)) {
			while (1) {
				if ((a[i] / pow(10,j) >= 1) && (a[i] / pow(10,j+1) < 1)) {
					sum += j+1;
					break;
				}
				j++;
			}
		}

		else {
			sum += 4;
		}
	}

	printf("%d", sum);

	return 0;

}
0