結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー focus
提出日時 2018-01-29 21:39:52
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 417 bytes
コンパイル時間 738 ms
コンパイル使用メモリ 89,084 KB
最終ジャッジ日時 2025-01-05 08:02:12
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
    int N,sum=0;
    for(int i=0;i<5;i++){
        cin >> N;
        if(N%3==0&&N%5==0)  sum+=8;
        else if(N%3==0&&N%5!=0) sum+=4;
        else if(N%3!=0&&N%5==0) sum+=4;
        else    for(;N!=0;N/=10){
                    sum++;
                }
    }
    cout << sum;
    return 0;
}
0