結果
| 問題 |
No.289 数字を全て足そう
|
| コンテスト | |
| ユーザー |
ta60143
|
| 提出日時 | 2018-10-24 17:56:19 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 432 bytes |
| コンパイル時間 | 12,634 ms |
| コンパイル使用メモリ | 383,356 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-19 05:32:32 |
| 合計ジャッジ時間 | 13,867 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
// fn main() {
// let abc = String::from("0123456789");
// let abc = abc.as_bytes();
// println!("{:?}", abc);
// }
fn main() {
let mut input = String::new();
std::io::stdin().read_line(&mut input).unwrap();
let input = input.trim().as_bytes();
let mut sum = 0u32;
for i in input {
if 48 <= *i && *i <= 57 {
sum += *i as u32 - 48;
}
}
println!("{}", sum);
}
ta60143