結果
問題 |
No.637 X: Yet Another FizzBuzz Problem
|
ユーザー |
![]() |
提出日時 | 2018-05-06 10:27:37 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 428 bytes |
コンパイル時間 | 1,020 ms |
コンパイル使用メモリ | 28,032 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 19:04:23 |
合計ジャッジ時間 | 880 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
#include <stdio.h> int counting(int num); int main(){ int i; int a[5]; int total=0,new; for(i=0;i<5;i++){ if(scanf("%d",&a[i])); } for(i=0;i<5;i++){ if(a[i]%5==0 &&a[i]%3==0){ total+=8; }else if(a[i]%3==0 || a[i]%5==0){ total+=4; }else{ new=counting(a[i]); total+=new; } } printf("%d",total); return 0; } int counting(int num){ int i; for(i=0;num>0;i++){ num=num/10; } return i; }