题解 | abc
abc
https://www.nowcoder.com/practice/912b15e237ef44148e44018d7b8750b6
import java.util.Scanner;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
for(int i = 100;i<=999;i++){
int a = i / 100;
int b = i / 10 % 10;
int c = i % 10;
if(b * 100 + c * 10 + c + i == 532){
System.out.println(a+" "+b+" "+c);
}
}
}
}
查看3道真题和解析