野声

Hey, 野声!

谁有天大力气可以拎着自己飞呀
twitter
github

ACM 输入输出语句

一些自己用的输入输出语句。

Python 输入

输入一行由空格切分的值

# py2
w = raw_input().split()
# py3
w = input().split()

输入整形变量

# py2
w = map(int,raw_input().split())
# py3
w = map(int,input().split())

JAVA 中在 OJ 上怎么实现多组输入

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
    		double a = sc.nextDouble();
			// DO
        }
	}
}

C 多组输入

int a, b;
while(scanf("%d%d", &a, &b) != EOF)
{
}

C++ 中在 OJ 上怎么实现多组输入

while(cin >> a >> b){
}
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.