sgu403.java

来自「SGU题库第四版前10题的题目解答。前三题是CPP程序」· Java 代码 · 共 28 行

JAVA
28
字号
import java.io.*;
import java.util.*;

public class Solution implements Runnable {
	Scanner in;
	PrintWriter out;
	
	public void run() {
		try {
			in = new Scanner(new FileReader("input.txt"));
			out = new PrintWriter(System.out);
			int x;
			while (in.hasNextInt())
				out.println(in.nextInt() * 2 + 1);
			in.close();
			out.close();
		}
		catch (Exception ex) {
			ex.printStackTrace();
			System.exit(-1);
		}
	}
	
	public static void main(String args[]) {
		new Thread(new Solution()).start();
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?