标签:inf system.in [] 奇偶数 tin 暴力 分类 意思 des
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); int n; n = cin.nextInt(); if((n & 1) == 1) { for(int i = 1; i <= 9; i++) { for(int j = 0; j <= 9; j++) { for(int k = 1; k <= 9; k += 2) { if(i * 2 + j * 2 + k == n) { // System.out.println(int(i * 1e4 + j * 1e3 + k * 1e2 + j * 1e1 + i)); System.out.println(i + "" + j + "" + k + "" + j + "" + i); } } } } } if((n & 1) == 0){ for(int i = 1; i <= 9; i++) { for(int j = 0; j <= 9; j++) { for(int k = 0; k <= 9; k++) { if(i * 2 + j * 2 + k == n) { // System.out.println(int(i * 1e4 + j * 1e3 + k * 1e2 + j * 1e1 + i)); System.out.println(i + "" + j + "" + k + "" + j + "" + i); } } } } for(int i = 1; i <= 9; i++) { for(int j = 0; j <= 9; j++) { for(int k = 0; k <= 9; k++) { if(i * 2 + j * 2 + k * 2 == n) { // System.out.println(int(i * 1e5 + j * 1e4 + k * 1e3 + k * 1e2 + j * 10 + i)); } System.out.println(i + "" + j + "" + k + "" + k + "" + j + "" + i); } } } } } } }
标签:inf system.in [] 奇偶数 tin 暴力 分类 意思 des
原文地址:https://www.cnblogs.com/zhumengdexiaobai/p/10348113.html