学一下输入输出
输入:
导入一个
import java.untils.Scanner;
慢的输入是:
Scanner sc = new Scanner(System.in);
int a = next.Int();
快的输入:
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main()
{
pubcli static void main(String[] args)
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String br = br.readLine();
System.out.println(str);
}
}
输出:
System.out.printf(“%d/n”,&x)
快一点的输出:
import java.io.BufferWriter;
import java.io.OutputStreamWriter;
public class Main()
{
public static void main(String[] args)
{
BufferedWriter bw=new BufferWriter(new OutputStreamWriter(System.out));
bw.writer(“hello world”);
bw.flush();//手动刷新缓冲区
}
}