結果
問題 |
No.8022 縛りFizzBuzz (Easy)
|
ユーザー |
![]() |
提出日時 | 2019-10-03 20:47:56 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 553 bytes |
コンパイル時間 | 945 ms |
コンパイル使用メモリ | 111,560 KB |
実行使用メモリ | 25,956 KB |
最終ジャッジ日時 | 2024-10-03 06:35:52 |
合計ジャッジ時間 | 1,560 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 4 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Linq; using static System.Console; using static System.Math; class Program { static void Main() { var n = int.Parse(ReadLine()); var z = 'a' - 'a'; var a = 'd' - 'a'; var b = 'f' - 'a'; for (int i = 1; i <= n; i++) { if (n % a == z && n % b == z) WriteLine("FizzBuzz"); else if (n % a == z) WriteLine("Fizz"); else if (n % b == z) WriteLine("Buzz"); else WriteLine(n); } } }