結果
問題 | No.637 X: Yet Another FizzBuzz Problem |
ユーザー |
![]() |
提出日時 | 2018-01-30 17:35:21 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 346 bytes |
コンパイル時間 | 476 ms |
コンパイル使用メモリ | 22,016 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-28 18:52:15 |
合計ジャッジ時間 | 992 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:12:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d",&a[i]); | ^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <string.h> #include <math.h> int main(void){ int i; int a[5]; int c=0; char s[4]; for(i=0;i<5;i++){ scanf("%d",&a[i]); } for(i=0;i<5;i++){ if(a[i]%15==0){ c+=8; }else if(a[i]%3==0){ c+=4; }else if(a[i]%5==0){ c+=4; }else{ sprintf(s,"%d",a[i]); c+=strlen(s); } } printf("%d\n",c); return 0; }