結果
| 問題 |
No.593 4進FizzBuzz
|
| コンテスト | |
| ユーザー |
No
|
| 提出日時 | 2018-01-21 02:37:52 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 998 bytes |
| コンパイル時間 | 777 ms |
| コンパイル使用メモリ | 103,168 KB |
| 実行使用メモリ | 28,928 KB |
| 最終ジャッジ日時 | 2024-12-25 15:28:27 |
| 合計ジャッジ時間 | 13,042 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 23 WA * 8 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
namespace y
{
class Program
{
static void Main(string[] args)
{
string n = Console.ReadLine();
int a = 0;
int b = 0;
int c = 0;
bool f = true;
foreach (var s in n)
{
a += int.Parse(Convert.ToString(s));
if (f)
{
b += int.Parse(Convert.ToString(s));
f = false;
}
else
{
c += int.Parse(Convert.ToString(s));
f = true;
}
}
string ans = "";
if (a % 3 == 0)
{
ans += "Fizz";
}
if ((b - c) % 11 == 0)
{
ans += "Buzz";
}
if (ans.Length == 0)
{
ans = n;
}
Console.WriteLine(ans);
}
}
}
No