0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

paizaラーニング「配列のソート Python3編」

Posted at

私の解答

n = int(input())
li = [int(x) for x in input().split()]
for ele in (sorted(li)):
    print(ele)

私の解答は解答例3に近かったです。

解答例1

N = int(input())

A = [0] * N
values = input().split()
for i in range(N):
    A[i] = int(values[i])

sorted_A = sorted(A)

for a in sorted_A:
    print(a)

解答例2

N = int(input())

A = [0] * N
values = input().split()
for i in range(N):
    A[i] = int(values[i])

A.sort()

for a in A:
    print(a)

解答例3

N = int(input())
A = [int(x) for x in input().split()]

for a in sorted(A):
    print(a)
0
0
0

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?