結果
| 問題 |
No.480 合計
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-27 01:04:13 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 226 bytes |
| コンパイル時間 | 13,299 ms |
| コンパイル使用メモリ | 400,576 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-14 09:20:57 |
| 合計ジャッジ時間 | 13,556 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
コンパイルメッセージ
warning: unused `Result` that must be used --> src/main.rs:4:5 | 4 | io::stdin().read_line(&mut line); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled = note: `#[warn(unused_must_use)]` on by default help: use `let _ = ...` to ignore the resulting value | 4 | let _ = io::stdin().read_line(&mut line); | +++++++
ソースコード
use std::io;
fn main() {
let mut line = String::new();
io::stdin().read_line(&mut line);
let mut sum = 0;
for i in 1..(line.trim().parse::<i32>().unwrap()+1) {
sum += i;
}
println!("{}", sum);
}