結果
| 問題 |
No.9001 標準入出力の練習問題(テスト用)
|
| ユーザー |
|
| 提出日時 | 2019-11-15 17:50:07 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 704 bytes |
| コンパイル時間 | 13,020 ms |
| コンパイル使用メモリ | 383,324 KB |
| 実行使用メモリ | 6,812 KB |
| 最終ジャッジ日時 | 2024-09-24 23:09:51 |
| 合計ジャッジ時間 | 13,677 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 |
ソースコード
use std::io;
use std::io::{Stdin, BufRead};
struct Input {
a: i32,
b: i32,
s: String,
}
fn main() {
let mut stdin = io::stdin();
let input = read_input(&mut stdin);
solve(input);
}
fn read_input(stdin: &mut Stdin) -> Input {
let mut lock = stdin.lock();
let mut s = String::new();
lock.read_line(&mut s).expect("can't read 1st line.");
let tokens: Vec<i32> = s.trim_end().split(" ").map(|s| s.parse().expect("can't parse")).collect();
s.clear();
lock.read_line(&mut s).expect("can't read 1st line.");
Input { a: tokens[0], b: tokens[1], s: s.trim_end().to_string() }
}
fn solve(input: Input) {
println!("{} {}", input.a + input.b, input.s);
}