結果

問題 No.499 7進数変換
ユーザー emine
提出日時 2017-04-12 04:46:35
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 24 ms / 1,000 ms
コード長 520 bytes
コンパイル時間 809 ms
コンパイル使用メモリ 103,552 KB
実行使用メモリ 17,920 KB
最終ジャッジ日時 2024-07-18 09:27:42
合計ジャッジ時間 2,413 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var sb = new StringBuilder();
            if (n == 0)
                sb.Append("0");
            while (n > 0)
            {
                sb.Insert(0, n % 7);
                n /= 7;
            }
            Console.WriteLine(sb.ToString());
        }
    }
}
0