結果

問題 No.593 4進FizzBuzz
ユーザー PE11PE11
提出日時 2018-01-23 11:52:22
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 1,016 bytes
コンパイル時間 2,912 ms
コンパイル使用メモリ 102,932 KB
実行使用メモリ 63,864 KB
最終ジャッジ日時 2023-08-26 23:17:39
合計ジャッジ時間 12,903 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
21,120 KB
testcase_01 AC 52 ms
21,040 KB
testcase_02 AC 50 ms
20,908 KB
testcase_03 AC 52 ms
21,256 KB
testcase_04 AC 52 ms
20,988 KB
testcase_05 AC 52 ms
21,004 KB
testcase_06 AC 53 ms
21,016 KB
testcase_07 AC 51 ms
21,136 KB
testcase_08 AC 50 ms
20,892 KB
testcase_09 AC 51 ms
22,944 KB
testcase_10 AC 52 ms
22,996 KB
testcase_11 AC 52 ms
20,960 KB
testcase_12 AC 51 ms
21,076 KB
testcase_13 AC 51 ms
20,968 KB
testcase_14 AC 53 ms
23,400 KB
testcase_15 AC 53 ms
23,232 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace _4FizzBuzz
{
	class Program
	{
		static void Main()
		{
			string InputNum = Console.ReadLine();
			Console.WriteLine(IsFizzBuzz(ConvertNumber(InputNum), InputNum));
		}

		public static int ConvertNumber(string InputNum)
		{
			var TempStack = new Stack<int>();

			foreach (var Num in InputNum)
				TempStack.Push(int.Parse(Num.ToString()));

			var NumList = new List<int>();

			do { NumList.Add(TempStack.Pop()); } while (TempStack.Count != 0);

			int ReturnNum = 0;

			for (int i = 0; i < NumList.Count; i++)
			{		
				ReturnNum += Convert.ToInt32(Math.Pow(4, i) * NumList[i]);
			}

			return ReturnNum;
		}

		public static string IsFizzBuzz(int Num, string InputNum)
		{
			if (Num % 3 == 0 && Num % 5 == 0)
				return "FizzBuzz";

			if (Num % 3 == 0)
				return "Fizz";

			if (Num % 5 == 0)
				return "Buzz";

			return InputNum;
		}

	}


}
0