結果
| 問題 |
No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
|
| ユーザー |
|
| 提出日時 | 2017-11-24 06:12:05 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 528 bytes |
| コンパイル時間 | 13,693 ms |
| コンパイル使用メモリ | 404,720 KB |
| 最終ジャッジ日時 | 2024-11-14 20:16:58 |
| 合計ジャッジ時間 | 14,436 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
error[E0283]: type annotations needed
--> src/main.rs:21:13
|
21 | sum += get!();
| ^^ cannot infer type
|
= note: multiple `impl`s satisfying `u64: AddAssign<_>` found in the `core` crate:
- impl AddAssign for u64;
- impl AddAssign<&u64> for u64;
For more information about this error, try `rustc --explain E0283`.
error: could not compile `main` (bin "main") due to 1 previous error
ソースコード
// yukicoder My Practice
// author: Leonardone @ NEETSDKASU
fn main() {
let mut stdin = String::new();
{
use std::io;
use std::io::Read;
io::stdin().read_to_string(&mut stdin).expect("failed to read string");
}
let mut stdin = stdin.split_whitespace();
macro_rules! get { () => ( stdin.next().unwrap().parse().unwrap() ) }
let n: u32 = get!();
let mut sum: u64 = 0;
for _ in 0..n {
sum += get!();
}
println!("{}", sum);
}