結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー mytkyt
提出日時 2018-03-28 01:55:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 392 bytes
コンパイル時間 898 ms
コンパイル使用メモリ 54,496 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 19:01:54
合計ジャッジ時間 1,269 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>

using namespace std;

int main(){
  int a[5];
  int sum=0;
  cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4];
  for(int i=0; i<5; i++){
    if(a[i]%3==0||a[i]%5==0){
      if(a[i]%3==0){
        sum+=4;
      }
      if(a[i]%5==0){
        sum+=4;
      }
    }else{
      while(a[i]>0){
        sum++;
        a[i]/=10;
      }
    }
  }
  cout << sum << endl;
  return 0;
}
0