結果
問題 |
No.289 数字を全て足そう
|
ユーザー |
![]() |
提出日時 | 2022-11-23 19:21:05 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 314 bytes |
コンパイル時間 | 14,420 ms |
コンパイル使用メモリ | 400,452 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-25 00:00:14 |
合計ジャッジ時間 | 15,517 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
use std::io::{self, BufRead}; fn main() { io::stdin().lock().lines().for_each(|l| { let sum = l .unwrap() .chars() .filter(|c| ('0'..='9').contains(c)) .map(|c| c.to_digit(10).unwrap()) .sum::<u32>(); println!("{}", sum); }); }