Java经典习题42

/*
题目:809*??=800*??+9*??+1    
其中??代表的两位数,8*??的结果为两位数,9*??的结果为3位数。
求??代表的两位数,及809*??后的结果。
*/
public class Class42 {

public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i = 10; i < 100; i++){
if((8*i >= 100) && (9*i <= 99)){
break;
}else{
if(809*i == 800*i + 9*i + 1){
System.out.println("该方程的解为:");
System.out.println(i);
}else{
System.out.println("该方程的不存在符合要求的解。");
}
}
}

}

}

猜你喜欢

转载自www.cnblogs.com/zhuozige/p/12358816.html