結果
問題 |
No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
|
ユーザー |
|
提出日時 | 2018-05-08 22:52:33 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 17 ms / 2,000 ms |
コード長 | 429 bytes |
コンパイル時間 | 12,694 ms |
コンパイル使用メモリ | 385,244 KB |
実行使用メモリ | 10,808 KB |
最終ジャッジ日時 | 2024-06-28 02:33:26 |
合計ジャッジ時間 | 13,698 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 15 |
ソースコード
use std::io::stdin; fn get_line() -> String { let mut line = String::new(); stdin().read_line(&mut line).ok(); line } fn main() { get_line(); let second_line = get_line(); let splited_line: Vec<&str> = second_line.trim().split(" ").collect(); let mut result: i64 = 0; for i in splited_line { let num: i64 = i.parse().unwrap(); result += num; } println!("{}", result); }