結果
問題 |
No.289 数字を全て足そう
|
ユーザー |
![]() |
提出日時 | 2017-02-23 15:29:58 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 374 bytes |
コンパイル時間 | 14,189 ms |
コンパイル使用メモリ | 249,056 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-02 18:30:28 |
合計ジャッジ時間 | 12,040 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
package main import ( "bufio" "fmt" "io" "os" ) func solve(in io.Reader, out, err io.Writer) { sum, temp := 0, []byte{} fmt.Fscan(in, &temp) for i := range temp { if temp[i] <= '9' && '0' <= temp[i] { sum += int(temp[i] - '0') } } fmt.Fprintln(out, sum) } func main() { br := bufio.NewReaderSize(os.Stdin, int(1e4)) solve(br, os.Stdout, os.Stderr) }