結果

問題 No.593 4進FizzBuzz
ユーザー PE11PE11
提出日時 2018-01-23 17:25:30
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,010 bytes
コンパイル時間 4,085 ms
コンパイル使用メモリ 101,832 KB
実行使用メモリ 37,200 KB
最終ジャッジ日時 2023-08-26 23:23:30
合計ジャッジ時間 12,394 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
21,540 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 51 ms
21,372 KB
testcase_04 AC 52 ms
21,388 KB
testcase_05 AC 51 ms
21,444 KB
testcase_06 WA -
testcase_07 AC 55 ms
23,496 KB
testcase_08 WA -
testcase_09 AC 54 ms
23,536 KB
testcase_10 WA -
testcase_11 AC 53 ms
23,520 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 312 ms
35,040 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 322 ms
35,096 KB
testcase_20 WA -
testcase_21 AC 318 ms
33,092 KB
testcase_22 AC 318 ms
35,208 KB
testcase_23 AC 308 ms
33,100 KB
testcase_24 AC 313 ms
33,044 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 319 ms
33,132 KB
testcase_28 WA -
testcase_29 AC 317 ms
31,052 KB
testcase_30 WA -
testcase_31 AC 306 ms
35,128 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 315 ms
37,200 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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(InputNum));
		}

		public static bool IsModThree(string InputNum)
		{
			int PlusNum = 0;

			foreach (var Num in InputNum)
				PlusNum += Convert.ToInt32(Num.ToString());

			if (PlusNum % 3 == 0)
				return true;

			else
				return false;
		}

		public static bool IsModFive(string InputNum)
		{
			int LastNum = Convert.ToInt32(InputNum.Last().ToString());

			if (LastNum % 5 == 0)
				return true;

			else
				return false;
		}

		public static string IsFizzBuzz(string InputNum)
		{
			bool IsThree = IsModThree(InputNum);
			bool IsFive = IsModFive(InputNum);

			if (IsThree && IsFive)
				return "FizzBuzz";

			if (IsThree)
				return "Fizz";

			if (IsFive)
				return "Buzz";

			return InputNum;
		}

	}


}
0