LoginSignup
0
0

More than 1 year has passed since last update.

paizaラーニング「さまざまな長さの配列の和 Python3編」

Last updated at Posted at 2023-01-18

この問題、結構考えたのですが、解りませんでした。

解答例

Python3
n = int(input())

for _ in range(n):
    k_a = [int(i) for i in input().split()]
    k = k_a[0]
    a = k_a[1:]
    s = 0
    for i in range(k):
        s += a[i]
    print(s)
0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0