题解 | 小美的因子查询
import java.util.Scanner; // 注意类名必须为 Main,不要有任何 package xxx 信息 public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int tt = scanner.nextInt(); while (tt > 0) { // 循环 tt 次 int n = scanner.nextInt(); // 判断 n 是否为偶数,如果是偶数输出 YES,否则输出 NO System.out.println((n % 2 == 0)? "YES" : "NO"); tt--; // 减少 tt 的值,控制循环次数 } } }