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問題集】標準出力メニュー/【n行の出力】1000行以内の出力

Posted at

Paiza問題集

Pythonで回答

標準出力メニュー/【n行の出力】1000行以内の出力

Step01 1行または2行の出力

"""
1行または2行の出力
https://paiza.jp/works/mondai/stdout_primer/stdout_primer__n_line_step1
"""

# 数値を受け取る
num = int(input())

# 数字を出力する
if num == 1:
    print(1)
elif num == 2:
    print(1)
    print(2)

Step02 数行の出力

"""
数行の出力
https://paiza.jp/works/mondai/stdout_primer/stdout_primer__n_line_step2
"""

# 数値を受け取る
num = int(input())

# 数行を表示する
for i in range(num):
    print(i)

Step03 10行以内の出力

"""
10行以内の出力
https://paiza.jp/works/mondai/stdout_primer/stdout_primer__n_line_step3
"""

# 数字を受け取る
num = int(input())

# 数行を表示する
for i in range(num):
    print(i + 1)

Final問題 【n行の出力】1000行以内の出力

"""
【n行の出力】1000行以内の出力
https://paiza.jp/works/mondai/stdout_primer/stdout_primer__n_line_boss
"""

# 数字を受け取る
num = int(input())

# 数行を表示する
for i in range(num):
    print(i + 1)
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?