結果

問題 No.56 消費税
ユーザー eringi103
提出日時 2016-10-21 09:59:25
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 601 bytes
コンパイル時間 2,389 ms
コンパイル使用メモリ 107,844 KB
実行使用メモリ 29,340 KB
最終ジャッジ日時 2024-11-23 16:01:05
合計ジャッジ時間 3,066 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 5 WA * 18
権限があれば一括ダウンロードができます
コンパイルメッセージ
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(Math.Floor(Kingaku));

    Console.WriteLine(result);
    
  }
}
0