求答案复习,不会写查询语句和C#那边的代码

img

第7题:

public class Shui
{
public static void main(String args[])
{
for(int x=100;x<=999;x++)
{
int a=x/100; //求得百位上的数字
int b=x/10-a10; //求得十位上的数字
//int c=x-a
100-b10; //求得个位上的数字
int c=x%10; //求得个位上的数字
int z=a
aa+bbb+cc*c;
if(x==z)
System.out.println("x:"+x+"是水仙花数");
}
}
}

第8题
public class CountRabbit {

public static void main(String[] args) {
    System.out.println("第1个月的兔子对数:    1");
    System.out.println("第2个月的兔子对数:    1");

// 默认r1是第一个月兔子对数,r2是第二个月兔子对数
int r1 = 1;
int r2 = 1;
// r是当前月的兔子对数
int r= 0;
for (int i = 3; i <= 20; i++) {
// 当前月的兔子对数,是上个月及上上个月兔子对数的和
r=r1+r2;
// 使用r1,r2保存最近两个月的数据
r1=r2;
r2=r;
System.out.println("第" + i + "个月的兔子对数: " + r);
}
}
}

上面的书上找找,应该都能找到的。编程题你就看我这个就行,解题思路需要加强