date [-d @int|str] [+%s|"+%F %T"] netstat -ltunp sar -n DEV 1
Java I/O
Java 最简单输入就是用 Scanner 类 但是很慢
1234567891011121314
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
int a,b;
while(cin.hasNext())
{
a=cin.nextInt(); b=cin.nextInt();
System.out.println(a+b);
}
}
}
输入用 StreamTokenizer ,输出用 PrintWriter 就 很快
1234567891011121314151617
import java.io.*;public class Main
{
public static void main(String[] args) throws IOException
{
StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
int a, b;
while(in.nextToken() != StreamTokenizer.TT_EOF)
{
a = (int)in.nval;
in.nextToken();
b = (int)in.nval;
out.println(a + b);
}
out.flush();
}
}