paizaラーニングレベルアップ問題集の【組になったデータの入力】をやってみた。

paizaラーニングレベルアップ問題集の【組になったデータの入力】をやってみました。
- - -
##### 問題
###### 1つの整数の組の入力
https://paiza.jp/works/mondai/stdin_primer/stdin_primer__pair_data_step1
###### N組の整数の入力
https://paiza.jp/works/mondai/stdin_primer/stdin_primer__pair_data_step2
###### 整数の組からの選択
https://paiza.jp/works/mondai/stdin_primer/stdin_primer__pair_data_step3
###### 文字列と整数の組の入力
https://paiza.jp/works/mondai/stdin_primer/stdin_primer__pair_data_step4
###### 文字列と整数の組からの選択
https://paiza.jp/works/mondai/stdin_primer/stdin_primer__pair_data_boss
- - -
今回は、受け取った値を配列に格納します。
一部の言語については、2つの配列に格納するコードと、`pair`や`tuple`の配列に格納するコードの2つを記載します。
尚、配列の添字は`0`から始まりますので、$8$番目の要素を選択する場合は添字`7`を指定します。（R言語は添字`1`から始まる、という話を聞いたことがありますが）
- - -
##### C
###### 1つの整数の組の入力
```c
#include <stdio.h>

int main() {
	int a, b;
	scanf("%d %d", &a, &b);
	printf("%d %d\n", a, b);
	return 0;
}
```
###### N組の整数の入力
```c
#include <stdio.h>

int main() {
	int N;
	scanf("%d", &N);
	int A[N];
	int B[N];
	for (int i = 0; i < N; i++) scanf("%d %d", &A[i], &B[i]);
	for (int i = 0; i < N; i++) printf("%d %d\n", A[i], B[i]);
	return 0;
}
```
```c
#include <stdio.h>

int main() {
	int N;
	scanf("%d", &N);
	int A[N][2];
	for (int i = 0; i < N; i++) scanf("%d %d", &A[i][0], &A[i][1]);
	for (int i = 0; i < N; i++) printf("%d %d\n", A[i][0], A[i][1]);
	return 0;
}
```
###### 整数の組からの選択
```c
#include <stdio.h>

int main() {
	int N;
	scanf("%d", &N);
	int A[N];
	int B[N];
	for (int i = 0; i < N; i++) scanf("%d %d", &A[i], &B[i]);
	printf("%d %d\n", A[7], B[7]);
	return 0;
}
```
```c
#include <stdio.h>

int main() {
	int N;
	scanf("%d", &N);
	int A[N][2];
	for (int i = 0; i < N; i++) scanf("%d %d", &A[i][0], &A[i][1]);
	printf("%d %d\n", A[7][0], A[7][1]);
	return 0;
}
```
###### 文字列と整数の組の入力
```c
#include <stdio.h>

int main() {
	int N;
	scanf("%d", &N);
	char S[N][11];
	int A[N];
	for (int i = 0; i < N; i++) scanf("%s %d", S[i], &A[i]);
	for (int i = 0; i < N; i++) printf("%s %d\n", S[i], A[i]);
	return 0;
}
```
###### 文字列と整数の組からの選択
```c
#include <stdio.h>

int main() {
	int N;
	scanf("%d", &N);
	char S[N][11];
	int A[N];
	for (int i = 0; i < N; i++) scanf("%s %d", S[i], &A[i]);
	printf("%s %d\n", S[7], A[7]);
	return 0;
}
```
- - -
##### C++
###### 1つの整数の組の入力
```cpp
#include <iostream>
#include <utility>
using namespace std;

int main() {
	pair<int, int> p;
	cin >> p.first >> p.second;
	cout << p.first << ' ' << p.second << endl;
	return 0;
}
```
###### N組の整数の入力
```cpp
#include <iostream>
using namespace std;

int main() {
	int N;
	cin >> N;
	int A[N], B[N];
	for (int i = 0; i < N; i++) cin >> A[i] >> B[i];
	for (int i = 0; i < N; i++) cout << A[i] << ' ' << B[i] << endl;
	return 0;
}
```
```cpp
#include <iostream>
#include <utility>
#include <vector>
using namespace std;

int main() {
	int N;
	cin >> N;
	vector<pair<int, int>> A(N);
	for (int i = 0; i < N; i++) cin >> A[i].first >> A[i].second;
	for (int i = 0; i < N; i++) cout << A[i].first << ' ' << A[i].second << endl;
	return 0;
}
```
###### 整数の組からの選択
```cpp
#include <iostream>
using namespace std;

int main() {
	int N;
	cin >> N;
	int A[N], B[N];
	for (int i = 0; i < N; i++) cin >> A[i] >> B[i];
	cout << A[7] << ' ' << B[7] << endl;
	return 0;
}
```
```cpp
#include <iostream>
#include <utility>
#include <vector>
using namespace std;

int main() {
	int N;
	cin >> N;
	vector<pair<int, int>> A(N);
	for (int i = 0; i < N; i++) cin >> A[i].first >> A[i].second;
	cout << A[7].first << ' ' << A[7].second << endl;
	return 0;
}
```
###### 文字列と整数の組の入力
```cpp
#include <iostream>
using namespace std;

int main() {
	int N;
	cin >> N;
	string S[N];
	int A[N];
	for (int i = 0; i < N; i++) cin >> S[i] >> A[i];
	for (int i = 0; i < N; i++) cout << S[i] << ' ' << A[i] << endl;
	return 0;
}
```
```cpp
#include <iostream>
#include <utility>
#include <vector>
using namespace std;

int main() {
	int N;
	cin >> N;
	vector<pair<string, int>> A(N);
	for (int i = 0; i < N; i++) cin >> A[i].first >> A[i].second;
	for (int i = 0; i < N; i++) cout << A[i].first << ' ' << A[i].second << endl;
	return 0;
}
```
###### 文字列と整数の組からの選択
```cpp
#include <iostream>
using namespace std;

int main() {
	int N;
	cin >> N;
	string S[N];
	int A[N];
	for (int i = 0; i < N; i++) cin >> S[i] >> A[i];
	cout << S[7] << ' ' << A[7] << endl;
	return 0;
}
```
```cpp
#include <iostream>
#include <utility>
#include <vector>
using namespace std;

int main() {
	int N;
	cin >> N;
	vector<pair<string, int>> A(N);
	for (int i = 0; i < N; i++) cin >> A[i].first >> A[i].second;
	cout << A[7].first << ' ' << A[7].second << endl;
	return 0;
}
```
- - -
##### C#
###### 1つの整数の組の入力
```cs
using System;

class Program
{
	public static void Main()
	{
		int[] ab = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
		Console.WriteLine("" + ab[0] + ' ' + ab[1]);
	}
}
```
###### N組の整数の入力
```cs
using System;

class Program
{
	public static void Main()
	{
		int N = int.Parse(Console.ReadLine());
		int[][] A = new int[N][];
		for (int i = 0; i < N; i++)
			A[i] = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
		for (int i = 0; i < N; i++)
			Console.WriteLine("" + A[i][0] + ' ' + A[i][1]);
	}
}
```
###### 整数の組からの選択
```cs
using System;

class Program
{
	public static void Main()
	{
		int N = int.Parse(Console.ReadLine());
		int[][] A = new int[N][];
		for (int i = 0; i < N; i++)
			A[i] = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
		Console.WriteLine("" + A[7][0] + ' ' + A[7][1]);
	}
}
```
###### 文字列と整数の組の入力
```cs
using System;

class Program
{
	public static void Main()
	{
		int N = int.Parse(Console.ReadLine());
		string[] S = new string[N];
		int[] A = new int[N];
		for (int i = 0; i < N; i++) {
			string[] sa = Console.ReadLine().Split();
			S[i] = sa[0];
			A[i] = int.Parse(sa[1]);
		}
		for (int i = 0; i < N; i++)
			Console.WriteLine(S[i] + " " + A[i]);
	}
}
```
###### 文字列と整数の組からの選択
```cs
using System;

class Program
{
	public static void Main()
	{
		int N = int.Parse(Console.ReadLine());
		string[] S = new string[N];
		int[] A = new int[N];
		for (int i = 0; i < N; i++) {
			string[] sa = Console.ReadLine().Split();
			S[i] = sa[0];
			A[i] = int.Parse(sa[1]);
		}
		Console.WriteLine(S[7] + " " + A[7]);
	}
}
```
- - -
##### Go
###### 1つの整数の組の入力
```go
package main
import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	fmt.Println(a, b)
}
```
```go
package main
import "fmt"

func main() {
	a := []int{ 0, 0 }
	fmt.Scan(&a[0], &a[1])
	fmt.Println(a[0], a[1])
}
```
###### N組の整数の入力
```go
package main
import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	A := make([]int, N)
	B := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scan(&A[i], &B[i])
	}
	for i := 0; i < N; i++ {
		fmt.Println(A[i], B[i])
	}
}
```
```go
package main
import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	A := make([][]int, N)
	for i := 0; i < N; i++ {
		A[i] = make([]int, 2)
		fmt.Scan(&A[i][0], &A[i][1])
	}
	for i := 0; i < N; i++ {
		fmt.Println(A[i][0], A[i][1])
	}
}
```
###### 整数の組からの選択
```go
package main
import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	A := make([]int, N)
	B := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scan(&A[i], &B[i])
	}
	fmt.Println(A[7], B[7])
}
```
```go
package main
import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	A := make([][]int, N)
	for i := 0; i < N; i++ {
		A[i] = make([]int, 2)
		fmt.Scan(&A[i][0], &A[i][1])
	}
	fmt.Println(A[7][0], A[7][1])
}
```
###### 文字列と整数の組の入力
```go
package main
import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	S := make([]string, N)
	A := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scan(&S[i], &A[i])
	}
	for i := 0; i < N; i++ {
		fmt.Println(S[i], A[i])
	}
}
```
###### 文字列と整数の組からの選択
```go
package main
import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	S := make([]string, N)
	A := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scan(&S[i], &A[i])
	}
	fmt.Println(S[7], A[7])
}
```
- - -
##### Java
###### 1つの整数の組の入力
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		System.out.println("" + a + ' ' + b);
		sc.close();
	}
}
```
###### N組の整数の入力
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		int[] B = new int[N];
		for (int i = 0; i < N; i++) {
			A[i] = sc.nextInt();
			B[i] = sc.nextInt();
		}
		sc.close();
		for (int i = 0; i < N; i++)
			System.out.println("" + A[i] + ' ' + B[i]);
	}
}
```
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[][] A = new int[N][];
		for (int i = 0; i < N; i++) {
			A[i] = new int[2];
			A[i][0] = sc.nextInt();
			A[i][1] = sc.nextInt();
		}
		sc.close();
		for (int i = 0; i < N; i++)
			System.out.println(A[i][0] + " " + A[i][1]);
	}
}
```
###### 整数の組からの選択
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		int[] B = new int[N];
		for (int i = 0; i < N; i++) {
			A[i] = sc.nextInt();
			B[i] = sc.nextInt();
		}
		sc.close();
		System.out.println("" + A[7] + ' ' + B[7]);
	}
}
```
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[][] A = new int[N][];
		for (int i = 0; i < N; i++) {
			A[i] = new int[2];
			A[i][0] = sc.nextInt();
			A[i][1] = sc.nextInt();
		}
		sc.close();
		System.out.println("" + A[7][0] + ' ' + A[7][1]);
	}
}
```
###### 文字列と整数の組の入力
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String[] S = new String[N];
		int[] A = new int[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
			A[i] = sc.nextInt();
		}
		sc.close();
		for (int i = 0; i < N; i++)
			System.out.println(S[i] + " " + A[i]);
	}
}
```
###### 文字列と整数の組からの選択
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String[] S = new String[N];
		int[] A = new int[N];
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
			A[i] = sc.nextInt();
		}
		sc.close();
		System.out.println(S[7] + " " + A[7]);
	}
}
```
- - -
##### JavaScript
###### 1つの整数の組の入力
```js
const [a, b] = require("fs").readFileSync("/dev/stdin", "utf8").split(' ').map(Number);
console.log(a, b);
```
###### N組の整数の入力
```js
const [N, ...ab] = require("fs").readFileSync("/dev/stdin", "utf8").trim().split('\n');
const AB = ab.map((s) => s.split(' ').map(Number));
for (var i = 0; i < N; i++) {
	const [a, b] = AB[i];
	console.log(a, b);
}
```
###### 整数の組からの選択
```js
const [N, ...ab] = require("fs").readFileSync("/dev/stdin", "utf8").trim().split('\n');
const AB = ab.map((s) => s.split(' ').map(Number));
const [a, b] = AB[7];
console.log(a, b);
```
###### 文字列と整数の組の入力
```js
const [N, ...ab] = require("fs").readFileSync("/dev/stdin", "utf8").trim().split('\n');
const AB = ab.map((s) => s.split(' '));
for (var i = 0; i < N; i++) {
	const [a, b] = [AB[i][0], Number(AB[i][1])];
	console.log(a, b);
}
```
###### 文字列と整数の組からの選択
```js
const [N, ...ab] = require("fs").readFileSync("/dev/stdin", "utf8").trim().split('\n');
const AB = ab.map((s) => s.split(' '));
const [a, b] = [AB[7][0], Number(AB[7][1])];
console.log(a, Number(b));
```
- - -
##### Kotlin
###### 1つの整数の組の入力
```kotlin
import java.util.*

fun main() {
	val sc = Scanner(System.`in`)
	val a = sc.nextInt()
	val b = sc.nextInt()
	println("" + a + ' ' + b)
	sc.close()
}
```
###### N組の整数の入力
```kotlin
import java.util.*

fun main() {
	val sc = Scanner(System.`in`)
	val N = sc.nextInt()
	val A = IntArray(N)
	val B = IntArray(N)
	for (i in 0 until N) {
		A[i] = sc.nextInt()
		B[i] = sc.nextInt()
	}
	sc.close()
	for (i in 0 until N)
		println("" + A[i] + ' ' + B[i])
}
```
```kotlin
import java.util.*

fun main() {
	val sc = Scanner(System.`in`)
	val N = sc.nextInt()
	val A = Array(N) { Pair(0, 0) }
	for (i in 0 until N) {
		A[i] = Pair(sc.nextInt(), sc.nextInt())
	}
	sc.close()
	for (i in 0 until N)
		println("" + A[i].first + ' ' + A[i].second)
}
```
###### 整数の組からの選択
```kotlin
import java.util.*

fun main() {
	val sc = Scanner(System.`in`)
	val N = sc.nextInt()
	val A = IntArray(N)
	val B = IntArray(N)
	for (i in 0 until N) {
		A[i] = sc.nextInt()
		B[i] = sc.nextInt()
	}
	sc.close()
	println("" + A[7] + ' ' + B[7])
}
```
```kotlin
import java.util.*

fun main() {
	val sc = Scanner(System.`in`)
	val N = sc.nextInt()
	val A = Array(N) { Pair(0, 0) }
	for (i in 0 until N) {
		A[i] = Pair(sc.nextInt(), sc.nextInt())
	}
	sc.close()
	println("" + A[7].first + ' ' + A[7].second)
}
```
###### 文字列と整数の組の入力
```kotlin
import java.util.*

fun main() {
	val sc = Scanner(System.`in`)
	val N = sc.nextInt()
	val A = Array(N) { "" }
	val B = IntArray(N)
	for (i in 0 until N) {
		A[i] = sc.next()
		B[i] = sc.nextInt()
	}
	sc.close()
	for (i in 0 until N)
		println(A[i] + ' ' + B[i])
}
```
```kotlin
import java.util.*

fun main() {
	val sc = Scanner(System.`in`)
	val N = sc.nextInt()
	val A = Array(N) { Pair("", 0) }
	for (i in 0 until N)
		A[i] = Pair(sc.next(), sc.nextInt())
	sc.close()
	for (i in 0 until N)
		println(A[i].first + ' ' + A[i].second)
}
```
###### 文字列と整数の組からの選択
```kotlin
import java.util.*

fun main() {
	val sc = Scanner(System.`in`)
	val N = sc.nextInt()
	val A = Array(N) { "" }
	val B = IntArray(N)
	for (i in 0 until N) {
		A[i] = sc.next()
		B[i] = sc.nextInt()
	}
	sc.close()
	println(A[7] + " " + B[7])
}
```
```kotlin
import java.util.*

fun main() {
	val sc = Scanner(System.`in`)
	val N = sc.nextInt()
	val A = Array(N) { Pair("", 0) }
	for (i in 0 until N) {
		A[i] = Pair(sc.next(), sc.nextInt())
	}
	sc.close()
	println(A[7].first + " " + A[7].second)
}
```
- - -
##### PHP
###### 1つの整数の組の入力
```php
<?php
	[$a, $b] = array_map("intval", explode(' ', fgets(STDIN)));
	echo "$a $b", PHP_EOL;
?>
```
###### N組の整数の入力
```php
<?php
	$N = intval(fgets(STDIN));
	$A = [];
	$B = [];
	for ($i = 0; $i < $N; $i++) {
		[$A[], $B[]] = array_map("intval", explode(' ', fgets(STDIN)));
	}
	for ($i = 0; $i < $N; $i++)
		echo "$A[$i] $B[$i]", PHP_EOL;
?>
```
```php
<?php
	$N = intval(fgets(STDIN));
	$A = [];
	for ($i = 0; $i < $N; $i++) {
		$A[] = array_map("intval", explode(' ', fgets(STDIN)));
	}
	for ($i = 0; $i < $N; $i++)
		echo $A[$i][0], " ", $A[$i][1], PHP_EOL;
?>
```
###### 整数の組からの選択
```php
<?php
	$N = intval(fgets(STDIN));
	$A = [];
	$B = [];
	for ($i = 0; $i < $N; $i++) {
		[$A[], $B[]] = array_map("intval", explode(' ', fgets(STDIN)));
	}
	echo $A[7], ' ', $B[7], PHP_EOL;
?>
```
```php
<?php
	$N = intval(fgets(STDIN));
	$A = [];
	for ($i = 0; $i < $N; $i++) {
		$A[] = array_map("intval", explode(' ', fgets(STDIN)));
	}
	echo $A[7][0], ' ', $A[7][1], PHP_EOL;
?>
```
###### 文字列と整数の組の入力
```php
<?php
	$N = intval(fgets(STDIN));
	$S = [];
	$A = [];
	for ($i = 0; $i < $N; $i++) {
		[$s, $a] = explode(' ', fgets(STDIN));
		$S[] = $s;
		$A[] = intval($a);
	}
	for ($i = 0; $i < $N; $i++)
		echo "$S[$i] $A[$i]", PHP_EOL;
?>
```
```php
<?php
	$N = intval(fgets(STDIN));
	$A = [];
	for ($i = 0; $i < $N; $i++) {
		[$s, $a] = explode(' ', fgets(STDIN));
		$A[] = [$s, intval($a)];
	}
	for ($i = 0; $i < $N; $i++)
		echo $A[$i][0], ' ', $A[$i][1], PHP_EOL;
?>
```
###### 文字列と整数の組からの選択
```php
<?php
	$N = intval(fgets(STDIN));
	$A = [];
	$B = [];
	for ($i = 0; $i < $N; $i++) {
		[$a, $b] = explode(' ', fgets(STDIN));
		$A[] = $a;
		$B[] = intval($b);
	}
	echo $A[7], ' ', $B[7], PHP_EOL;
?>
```
```php
<?php
	$N = intval(fgets(STDIN));
	$A = [];
	for ($i = 0; $i < $N; $i++) {
		[$a, $b] = explode(' ', fgets(STDIN));
		$A[] = [$a, intval($b)];
	}
	echo $A[7][0], ' ', $A[7][1], PHP_EOL;
?>
```
- - -
##### Perl
###### 1つの整数の組の入力
```pl
my ($a, $b) = map { int($_) } split ' ', <STDIN>;
print "$a $b$/";
```
###### N組の整数の入力
```pl
my $N = int(<STDIN>);
my @A, @B;
for (my $i = 0; $i < $N; $i++) {
	my ($a, $b) = map { int($_) } split ' ', <STDIN>;
	push @A, $a;
	push @B, $b;
}
for (my $i = 0; $i < $N; $i++) {
	print "$A[$i] $B[$i]$/";
}
```
```pl
my $N = int(<STDIN>);
my @A;
for (my $i = 0; $i < $N; $i++) {
	push @A, [map { int($_) } split ' ', <STDIN>];
}
for (my $i = 0; $i < $N; $i++) {
	print "$A[$i][0] $A[$i][1]$/";
}
```
###### 整数の組からの選択
```pl
my $N = int(<STDIN>);
my @A, @B;
for (my $i = 0; $i < $N; $i++) {
	my ($a, $b) = map { int($_) } split ' ', <STDIN>;
	push @A, $a;
	push @B, $b;
}
print "$A[7] $B[7]$/";
```
```pl
my $N = int(<STDIN>);
my @A;
for (my $i = 0; $i < $N; $i++) {
	push @A, [map { int($_) } split ' ', <STDIN>];
}
print "$A[7][0] $A[7][1]$/";
```
###### 文字列と整数の組の入力
```pl
my $N = int(<STDIN>);
my @S, @A;
for (my $i = 0; $i < $N; $i++) {
	my ($s, $a) = split ' ', <STDIN>;
	push @S, $s;
	push @A, int($a);
}
for (my $i = 0; $i < $N; $i++) {
	print "$S[$i] $A[$i]$/";
}
```
```pl
my $N = int(<STDIN>);
my @A;
for (my $i = 0; $i < $N; $i++) {
	my ($s, $a) = split ' ', <STDIN>;
	push @A, [$s, int($a)];
}
for (my $i = 0; $i < $N; $i++) {
	print "$A[$i][0] $A[$i][1]$/";
}
```
###### 文字列と整数の組からの選択
```pl
my $N = int(<STDIN>);
my @S, @A;
for (my $i = 0; $i < $N; $i++) {
	my ($s, $a) = split ' ', <STDIN>;
	push @S, $s;
	push @A, int($a);
}
print "$S[7] $A[7]$/";
```
```pl
my $N = int(<STDIN>);
my @A;
for (my $i = 0; $i < $N; $i++) {
	my ($s, $a) = split ' ', <STDIN>;
	push @A, [$s, int($a)];
}
print "$A[7][0] $A[7][1]$/";
```
- - -
##### Python3
###### 1つの整数の組の入力
```py
a, b = map(int, input().split())
print(a, b)
```
###### N組の整数の入力
```py
N = int(input())
A = []
B = []
for _ in range(N):
	a, b = map(int, input().split())
	A.append(a)
	B.append(b)
for a, b in zip(A, B):
	print(a, b)
```
```py
N = int(input())
A = []
for _ in range(N):
	A.append(list(map(int, input().split())))
	# A.append([int(a) for a in input().split()]) でも可。
for i in range(N):
	print(*A[i])
```
###### 整数の組からの選択
```py
N = int(input())
A = []
B = []
for _ in range(N):
	a, b = map(int, input().split())
	A.append(a)
	B.append(b)
print(A[7], B[7])
```
```py
N = int(input())
A = []
for _ in range(N):
	A.append(list(map(int, input().split())))
	# A.append([int(a) for a in input().split()]) でも可。
print(*A[7])
```
###### 文字列と整数の組の入力
```py
N = int(input())
S = []
A = []
for _ in range(N):
	s, a = input().split()
	S.append(s)
	A.append(int(a))
for s, a in zip(S, A):
	print(s, a)
```
```py
N = int(input())
A = []
for _ in range(N):
	s, a = input().split()
	A.append((s, int(a)))
for i in range(N):
	print(*A[i])
```
###### 文字列と整数の組からの選択
```py
N = int(input())
S = []
A = []
for _ in range(N):
	s, a = input().split()
	S.append(s)
	A.append(int(a))
print(S[7], A[7])
```
```py
N = int(input())
A = []
for _ in range(N):
	s, a = input().split()
	A.append((s, int(a)))
print(*A[7])
```
- - -
##### Ruby
###### 1つの整数の組の入力
```rb
a, b = gets.split.map(&:to_i)
print a, ' ', b, "\n"
```
###### N組の整数の入力
```rb
N = gets.to_i
A = []
B = []
N.times do
	a, b = gets.split.map(&:to_i)
	A << a
	B << b
end
N.times do |i|
	print A[i], ' ', B[i], "\n"
end
```
```rb
N = gets.to_i
A = []
N.times do
	A << gets.split.map(&:to_i)
end
N.times do |i|
	puts A[i].join(' ')
end
```
###### 整数の組からの選択
```rb
N = gets.to_i
A = []
B = []
N.times do
	a, b = gets.split.map(&:to_i)
	A << a
	B << b
end
print A[7], ' ', B[7], "\n"
```
```rb
N = gets.to_i
A = []
N.times do
	A << gets.split.map(&:to_i)
end
puts A[7].join(' ')
```
###### 文字列と整数の組の入力
```rb
N = gets.to_i
S = []
A = []
N.times do
	s, a = gets.split
	S << s
	A << a.to_i
end
N.times do |i|
	print S[i], ' ', A[i], "\n"
end
```
```rb
N = gets.to_i
A = []
N.times do
	s, a = gets.split
	A << [s, a]
end
N.times do |i|
	puts A[i].join(' ')
end
```
###### 文字列と整数の組からの選択
```rb
N = gets.to_i
S = []
A = []
N.times do
	s, a = gets.split
	S << s
	A << a.to_i
end
print S[7], ' ', A[7], "\n"
```
```rb
N = gets.to_i
A = []
N.times do
	s, a = gets.split
	A << [s, a]
end
puts A[7].join(' ')
```
- - -
##### Scala
###### 1つの整数の組の入力
```scala
import scala.io.StdIn._

object Main extends App{
	val Array(a, b) = readLine().split(' ').map(_.toInt)
	println("" + a + ' ' + b)
}
```
###### N組の整数の入力
```scala
import scala.io.StdIn._

object Main extends App{
	val N = readInt()
	val A = new Array[Int](N)
	val B = new Array[Int](N)
	for (i <- 0 until N) {
		val Array(a, b) = readLine().split(' ').map(_.toInt)
		A(i) = a
		B(i) = b
	}
	for (i <- 0 until N) {
		println("" + A(i) + ' ' + B(i))
	}
}
```
```scala
import scala.io.StdIn._

object Main extends App{
	val N = readInt()
	val A = new Array[(Int, Int)](N)
	for (i <- 0 until N) {
		val Array(a, b) = readLine().split(' ').map(_.toInt)
		A(i) = (a, b)
	}
	for (i <- 0 until N) {
		println("" + A(i)._1 + ' ' + A(i)._2)
	}
}
```
###### 整数の組からの選択
```scala
import scala.io.StdIn._

object Main extends App{
	val N = readInt()
	val A = new Array[Int](N)
	val B = new Array[Int](N)
	for (i <- 0 until N) {
		val Array(a, b) = readLine().split(' ').map(_.toInt)
		A(i) = a
		B(i) = b
	}
	println("" + A(7) + ' ' + B(7))
}
```
```scala
import scala.io.StdIn._

object Main extends App{
	val N = readInt()
	val A = new Array[(Int, Int)](N)
	for (i <- 0 until N) {
		val Array(a, b) = readLine().split(' ').map(_.toInt)
		A(i) = (a, b)
	}
	println("" + A(7)._1 + ' ' + A(7)._2)
}
```
###### 文字列と整数の組の入力
```scala
import scala.io.StdIn._

object Main extends App{
	val N = readInt()
	val S = new Array[String](N)
	val A = new Array[Int](N)
	for (i <- 0 until N) {
		val Array(s, a) = readLine().split(' ')
		S(i) = s
		A(i) = a.toInt
	}
	for (i <- 0 until N) {
		println(S(i) + ' ' + A(i))
	}
}
```
```scala
import scala.io.StdIn._

object Main extends App{
	val N = readInt()
	val A = new Array[(String, Int)](N)
	for (i <- 0 until N) {
		val Array(s, a) = readLine().split(' ')
		A(i) = (s, a.toInt)
	}
	for (i <- 0 until N)
		println("" + A(i)._1 + ' ' + A(i)._2)
}
```
###### 文字列と整数の組からの選択
```scala
import scala.io.StdIn._

object Main extends App{
	val N = readInt()
	val S = new Array[String](N)
	val A = new Array[Int](N)
	for (i <- 0 until N) {
		val Array(s, a) = readLine().split(' ')
		S(i) = s
		A(i) = a.toInt
	}
	println(S(7) + ' ' + A(7))
}
```
```scala
import scala.io.StdIn._

object Main extends App{
	val N = readInt()
	val A = new Array[(String, Int)](N)
	for (i <- 0 until N) {
		val Array(s, a) = readLine().split(' ')
		A(i) = (s, a.toInt)
	}
	println("" + A(7)._1 + " " + A(7)._2)
}
```
- - -
##### Swift
###### 1つの整数の組の入力
```swift
let ab = readLine()!.split(separator: " ").map { Int($0)! }
print(ab[0], ab[1])
```
###### N組の整数の入力
```swift
let N = Int(readLine()!)!
var A: [Int] = []
var B: [Int] = []
for _ in 0..<N {
	let ab = readLine()!.split(separator: " ").compactMap { Int($0) }
	A.append(ab[0])
	B.append(ab[1])
}
for i in 0..<N {
	print(A[i], B[i])
}
```
```swift
let N = Int(readLine()!)!
var A: [(Int, Int)] = []
for _ in 0..<N {
	let ab = readLine()!.split(separator: " ").compactMap { Int($0) }
	A.append((ab[0], ab[1]))
}
for i in 0..<N {
	print(A[i].0, A[i].1)
}
```
###### 整数の組からの選択
```swift
let N = Int(readLine()!)!
var A: [Int] = []
var B: [Int] = []
for _ in 0..<N {
	let ab = readLine()!.split(separator: " ").compactMap { Int($0) }
	A.append(ab[0])
	B.append(ab[1])
}
print(A[7], B[7])
```
```swift
let N = Int(readLine()!)!
var A: [(Int, Int)] = []
for _ in 0..<N {
	let ab = readLine()!.split(separator: " ").compactMap { Int($0) }
	A.append((ab[0], ab[1]))
}
print(A[7].0, A[7].1)
```
###### 文字列と整数の組の入力
```swift
let N = Int(readLine()!)!
var S: [String] = []
var A: [Int] = []
for _ in 0..<N {
	let sa = readLine()!.split(separator: " ")
	S.append(String(sa[0]))
	A.append(Int(sa[1])!)
}
for i in 0..<N {
	print(S[i], A[i])
}
```
```swift
let N = Int(readLine()!)!
var A: [(String, Int)] = []
for _ in 0..<N {
	let sa = readLine()!.split(separator: " ")
	A.append((String(sa[0]), Int(sa[1])!))
}
for i in 0..<N {
	print(A[i].0, A[i].1)
}
```
###### 文字列と整数の組からの選択
```swift
let N = Int(readLine()!)!
var S: [String] = []
var A: [Int] = []
for _ in 0..<N {
	let sa = readLine()!.split(separator: " ")
	S.append(String(sa[0]))
	A.append(Int(sa[1])!)
}
print(S[7], A[7])
```
```swift
let N = Int(readLine()!)!
var A: [(String, Int)] = []
for _ in 0..<N {
	let sa = readLine()!.split(separator: " ")
	A.append((String(sa[0]), Int(sa[1])!))
}
print(A[7].0, A[7].1)
```