結果

問題 No.499 7進数変換
ユーザー PE11
提出日時 2017-10-27 17:50:50
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 27 ms / 1,000 ms
コード長 563 bytes
コンパイル時間 1,176 ms
コンパイル使用メモリ 110,188 KB
実行使用メモリ 26,464 KB
最終ジャッジ日時 2024-11-21 21:20:34
合計ジャッジ時間 3,097 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Text;
using System.Threading.Tasks;

namespace YukiCoder
{
	public class QuestionNo499
	{
		public static void Main()
		{
			decimal InputNum = Convert.ToDecimal(Console.ReadLine());

			Stack<decimal> SevenNum = new Stack<decimal>();

			while(InputNum >= 7)
			{
				SevenNum.Push(InputNum % 7);
				InputNum = (InputNum - (InputNum % 7)) / 7;
			}
			SevenNum.Push(InputNum);

			
			for (int i = SevenNum.Count; i > 0; i--)
			{
				Console.Write(SevenNum.Pop());
			}
		}

	}
}
0