結果
| 問題 | No.9002 FizzBuzz(テスト用) |
| ユーザー |
|
| 提出日時 | 2017-03-21 20:04:51 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 20 ms / 5,000 ms |
| コード長 | 430 bytes |
| 記録 | |
| コンパイル時間 | 2,007 ms |
| コンパイル使用メモリ | 105,216 KB |
| 実行使用メモリ | 17,664 KB |
| 最終ジャッジ日時 | 2024-07-06 05:57:36 |
| 合計ジャッジ時間 | 2,791 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
class HelloWorld
{
public static void Main()
{
int n = int.Parse(Console.ReadLine());
Func<int, string> fz = (i) =>
{
if (i % 3 == 0 && i % 5 == 0)
{
return "FizzBuzz";
}
else if (i % 3 == 0)
{
return "Fizz";
}
else if (i % 5 == 0)
{
return "Buzz";
}
else
{
return "" + (i);
}
};
for (int i = 1; i <= n; i++)
{
Console.WriteLine(fz(i));
}
}
}