結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー Maeda
提出日時 2025-03-11 10:28:05
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 335 bytes
コンパイル時間 1,375 ms
コンパイル使用メモリ 24,960 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-11 10:28:08
合計ジャッジ時間 1,735 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |                 scanf("%d",&num);
      |                 ^~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void){
	int num = 0 ,ans = 0;
	for(int i = 0 ; i < 5 ; i++){
		scanf("%d",&num);
		if(num%3 == 0 && num%5 == 0){
			ans += 8;
		}else if(num%3 == 0 && num%5 != 0 || num%3 != 0 && num%5 == 0){
			ans += 4;
		}else{
			while(num!=0){
    			num = num / 10;
    			ans++;
			}
		}
	}    

	printf("%d",ans);
}
0