java 刷题的快速读写
用于输入输出引起的TLE
主要三个函数:(注意还要抛出异常)
in.readLine().trim() 一行一行读,加上字符串处理,trim()是消除首尾空白字符,一般也可以不加
out.println()//out有很多输出方式
out.flush()
import java.io.*;
import java.util.*;
public class Main
{
public static void main(String []args) throws IOException
{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
PrintWriter out=new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
n=Integer.parseInt(in.readLine().trim());
for(int i=0;i<n;++i)
{
String ss[]=in.readLine().trim().split(" ");
x=Integer.parseInt(ss[0]);
y=Integer.parseInt(ss[1]);
}
for(int i=0;i<n;++i)out.println(leavl[i]);
out.flush();
}
}