結果
| 問題 |
No.289 数字を全て足そう
|
| コンテスト | |
| ユーザー |
mesh1nek0x0
|
| 提出日時 | 2018-09-12 09:10:44 |
| 言語 | Go (1.23.4) |
| 結果 |
AC
|
| 実行時間 | 14 ms / 1,000 ms |
| コード長 | 355 bytes |
| コンパイル時間 | 17,180 ms |
| コンパイル使用メモリ | 236,860 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-26 06:33:46 |
| 合計ジャッジ時間 | 16,737 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
package main
import (
"fmt"
"regexp"
"strconv"
)
func main() {
var S string
fmt.Scan(&S)
r := regexp.MustCompile(`[0-9]`)
numbers := r.FindAllString(S, -1)
sum := 0
for i := 0; i < len(numbers); i++ {
tmp, err := strconv.Atoi(numbers[i])
if err != nil {
// handle error
}
sum += tmp
}
fmt.Println(sum)
}
mesh1nek0x0