5
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 5 years have passed since last update.

MDG(名古屋大学 安田・遠藤・浦田研究室)Advent Calendar 2019

Day 1

Paizaをやるときに役立つ??Python標準入力取得方法

Last updated at Posted at 2019-11-30

はじめに

MDG(名古屋大学 安田・遠藤・浦田研究室) Advent Calendar 2019 初日(12/1)に投稿させていただきました!!
プログラミングを始めて2年弱 & Qiitaへの投稿は初めてなので, もっときれいなコードの書き方はあるかと思います. アドバイスがあればどんどんコメントいただけると幸いです.

Python3での標準入力取得方法

複数行かつ複数列の標準入力取得

num = [list(map(int, input().split())) for i in range(2)]

複数行かつ1列の標準入力取得

n,m = [int(input()) for i in range("行数")]

1行かつ複数列の標準入力取得

a,b=map(int,input().split())

多次元配列の値取得の記述

answer = num[0][0]*num[1][1]-num[0][1]*num[1][0]
5
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
5
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?