結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー chacoder1
提出日時 2021-12-30 16:52:18
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 431 bytes
コンパイル時間 1,755 ms
コンパイル使用メモリ 193,400 KB
最終ジャッジ日時 2025-01-27 07:38:55
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

int c[10];

signed main(){
  int n;
  int ans=0;
  rep(i,5){
    cin>>n;
    if(n%3==0 && n%5==0){
      ans+=8;
      continue;
    }
    if(n%3==0){
      ans+=4;
      continue;
    }
    if(n%5==0){
      ans+=4;
      continue;
    }
    if(n<10) ans+=1;
    else if (n<100) ans+=2;
    else ans+=3;
  }
  cout<<ans<<endl;    
  return 0;
}
0