//对标牛客竞赛小白月赛109 a题
//
import java.util.*; import java.io.*; public class Main{ static long n; static BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); static PrintWriter wt = new PrintWriter(new OutputStreamWriter(System.out)); public static void main(String[] args)throws Exception{ int t = nextInt(); while (t -- > 0){ n = nextLong(); if (n <= 2) wt.println(n); else { if ((n % 2) == 1) wt.println(3); else wt.println(2); } } wt.flush(); } public static int nextInt() throws Exception {//int型 return Integer.parseInt(bf.readLine()); } public static long nextLong() throws Exception {//long型 return Long.parseLong(bf.readLine()); } }
标签:PrintWriter,Java,java,读出,写入,System,static,new From: https://www.cnblogs.com/liliczw2209/p/17178203.html