結果
| 問題 |
No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
|
| ユーザー |
|
| 提出日時 | 2017-11-24 06:14:05 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 512 bytes |
| コンパイル時間 | 12,210 ms |
| コンパイル使用メモリ | 389,516 KB |
| 最終ジャッジ日時 | 2024-11-14 20:16:44 |
| 合計ジャッジ時間 | 12,988 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
error[E0283]: type annotations needed
--> src/main.rs:20:13
|
20 | 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::Read;
std::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);
}