結果
| 問題 |
No.9002 FizzBuzz(テスト用)
|
| ユーザー |
Kura
|
| 提出日時 | 2019-09-22 19:02:10 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 23 ms / 5,000 ms |
| コード長 | 2,489 bytes |
| コンパイル時間 | 981 ms |
| コンパイル使用メモリ | 112,272 KB |
| 実行使用メモリ | 17,664 KB |
| 最終ジャッジ日時 | 2024-09-19 03:42:58 |
| 合計ジャッジ時間 | 1,592 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 Start
{
static void Main()
{
long n;Inl(out n);
for (int i = 1; i <= n; i++) Outl(i % 3 == 0 ? (i % 5 == 0 ? "FizzBuzz" : "Fizz") : (i % 5 == 0 ? "Buzz" : i + ""));
}
static void Inl<T>(out T t)
{
Type type = typeof(T);
if (type == LONG) t = (T)(object)long.Parse(Console.ReadLine());
else if (type == STRING) t = (T)(object)Console.ReadLine();
else if (type == CHAR) t = (T)(object)Console.ReadLine()[0];
else t = (T)(object)double.Parse(Console.ReadLine());
}
static void Inl<T, U>(out T t, out U u) { string[] s = Console.ReadLine().Split(); In(out t, ref s, 0); In(out u, ref s, 1); }
static void Inl<T, U, V>(out T t, out U u, out V v) { string[] s = Console.ReadLine().Split(); In(out t, ref s, 0); In(out u, ref s, 1); In(out v, ref s, 2); }
static void Inl<T, U, V, W>(out T t, out U u, out V v, out W w) { string[] s = Console.ReadLine().Split(); In(out t, ref s, 0); In(out u, ref s, 1); In(out v, ref s, 2); In(out w, ref s, 3); }
static void Inl<T, U, V, W, X>(out T t, out U u, out V v, out W w, out X x) { string[] s = Console.ReadLine().Split(); In(out t, ref s, 0); In(out u, ref s, 1); In(out v, ref s, 2); In(out w, ref s, 3); In(out x, ref s, 4); }
static void Inl<T, U, V, W, X, Y>(out T t, out U u, out V v, out W w, out X x, out Y y) { string[] s = Console.ReadLine().Split(); In(out t, ref s, 0); In(out u, ref s, 1); In(out v, ref s, 2); In(out w, ref s, 3); In(out x, ref s, 4); In(out y, ref s, 5); }
static void Inl<T, U, V, W, X, Y, Z>(out T t, out U u, out V v, out W w, out X x, out Y y, out Z z) { string[] s = Console.ReadLine().Split(); In(out t, ref s, 0); In(out u, ref s, 1); In(out v, ref s, 2); In(out w, ref s, 3); In(out x, ref s, 4); In(out y, ref s, 5); In(out z, ref s, 6); }
static void In<T>(out T t, ref string[] s, int i)
{
Type type = typeof(T);
if (type == LONG) t = (T)(object)long.Parse(s[i]);
else if (type == STRING) t = (T)(object)s[i];
else if (type == CHAR) t = (T)(object)s[i][0];
else t = (T)(object)double.Parse(s[i]);
}
static Type LONG = typeof(long);
static Type STRING = typeof(string);
static Type CHAR = typeof(char);
static void Out<T>(T t) { Console.Write(t); }
static void Outl<T>(T t) { Console.WriteLine(t); }
static void Swap<T>(ref T a, ref T b) { T c = a; a = b; b = c; }
}
Kura