for (int i = 1000; i <= 9999; i++) {
int a = i / 1000;
int b = i % 1000 / 100;
int c = i % 100 / 10;
int d = i % 10;
int i1 = (a * 10 + b) + (c * 10 + d);
if (i1 * i1 == a * 1000 + b * 100 + c * 10 + d) {
System.out.println(i);
}
}
(for 循环)*编程找出四位整数abcd 中满足下述关系的数。 (ab+cd)(ab+cd)=abcd
最新推荐文章于 2022-10-14 08:40:00 发布