Output all palindromic numbers with five digits

Output a five-digit palindrome

Emphasis
* " / " * to go to the front of the number "%" to go to the back of the number. then compare

for (int i = 10000; i <=99999; i++) {
    
    
			int a=i/10000;取第一位
			int b=i/1000%10;取第二位
			int c=i/10%10;取第四位
			int d=i%10;取第五位
			if (a==d&&b==c) {
    
    判断对应位置数字是否相同
				System.out.println(i);
			}
		}

Guess you like

Origin blog.csdn.net/qq1163245614/article/details/116905341