結果

問題 No.56 消費税
ユーザー eringi103
提出日時 2016-10-21 10:04:13
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 639 bytes
コンパイル時間 2,389 ms
コンパイル使用メモリ 107,084 KB
実行使用メモリ 27,480 KB
最終ジャッジ日時 2024-11-23 16:02:18
合計ジャッジ時間 4,189 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 4
other RE * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

public class Program
{
  static void Main()
  {
    string Kingaku_ = Console.ReadLine();
    string Yukikoda_ = "";
    string P_ = "";
    int i = 0;

    while (Kingaku_.Substring(i,1) != " ")
    {
      Yukikoda_ = Yukikoda_ + Kingaku_.Substring(i,1);
      i++;
    }
    P_ = Kingaku_.Substring(i + 1, 1);

    int Yukikoda = Convert.ToInt32(Yukikoda_);
    int P = Convert.ToInt32(P_);

    double Kingaku = Yukikoda + (Yukikoda * P / 100);
    string result = Convert.ToString(Kingaku);
    int k = result.IndexOf(".");
    result.Remove(k);

    Console.WriteLine(result);

  }
}
0