結果
| 問題 | No.56 消費税 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-03-27 17:55:14 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 604 bytes |
| コンパイル時間 | 13,690 ms |
| コンパイル使用メモリ | 403,592 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-01-02 09:02:33 |
| 合計ジャッジ時間 | 12,169 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 23 |
ソースコード
use std::io;
use std::io::{Stdin, BufRead};
struct Input {
amount: i32,
vat: i32,
}
fn main() {
let mut stdin = io::stdin();
let input = read_input(&mut stdin);
println!("{}", (input.amount * (100 + input.vat) / 100));
}
fn read_input(stdin: &mut Stdin) -> Input {
let mut lock = stdin.lock();
let mut s = String::new();
lock.read_line(&mut s).expect("can not read first line");
let tokens: Vec<i32> = s.trim_end().split(" ").map(|s| s.parse().expect("can't parse")).collect();
s.clear();
Input {
amount: tokens[0],
vat: tokens[1],
}
}