結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー curryudon08
提出日時 2020-06-23 16:18:10
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 28 ms / 1,000 ms
コード長 679 bytes
コンパイル時間 2,427 ms
コンパイル使用メモリ 113,780 KB
実行使用メモリ 27,372 KB
最終ジャッジ日時 2024-07-03 19:19:09
合計ジャッジ時間 4,227 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

namespace _0637
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();

            var cnt = 0;
            foreach(var n in s){
                if(n % 3 == 0 && n % 5 == 0){
                    cnt += "FizzBuzz".Length;
                }else if(n % 3 == 0){
                    cnt += "Fizz".Length;
                }else if(n % 5 == 0){
                    cnt += "Buzz".Length;
                }else{
                    cnt += n.ToString().Length;
                }
            }

            Console.WriteLine(cnt);
        }
    }
}
0