結果
問題 | No.637 X: Yet Another FizzBuzz Problem |
ユーザー |
![]() |
提出日時 | 2018-01-27 01:25:26 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 25 ms / 1,000 ms |
コード長 | 532 bytes |
コンパイル時間 | 741 ms |
コンパイル使用メモリ | 110,512 KB |
実行使用メモリ | 19,200 KB |
最終ジャッジ日時 | 2024-06-28 18:50:01 |
合計ジャッジ時間 | 2,291 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.
ソースコード
using System; using System.Linq; namespace y { class Program { static void Main(string[] args) { var a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray(); int c = 0; foreach (var i in a) { if (i % 3 == 0 && i % 5 == 0) c += 8; else if (i % 3 == 0) c += 4; else if (i % 5 == 0) c += 4; else c += i.ToString().Length; } Console.WriteLine(c); } } }