結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー O20LQ7O20LQ7
提出日時 2022-11-12 23:16:19
言語 Go
(1.22.1)
結果
RE  
実行時間 -
コード長 341 bytes
コンパイル時間 10,879 ms
コンパイル使用メモリ 207,508 KB
実行使用メモリ 4,480 KB
最終ジャッジ日時 2023-10-12 12:21:15
合計ジャッジ時間 12,313 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {

	s1 := bufio.NewScanner(os.Stdin)
	s1.Scan()
	n, _ := strconv.Atoi(s1.Text())
	s2 := bufio.NewScanner(os.Stdin)
	s2.Scan()
	v := strings.Fields(s2.Text())
	sum := 0

	for i := 0; i < n; i++ {
		l, _ := strconv.Atoi(v[i])
		sum += l
	}
	fmt.Println(sum)

}
0