请教两道JAVA编程题?

来源:百度知道 编辑:UC知道 时间:2024/05/22 06:00:31
在JCreator中写出:1.
*
* *
* * *
* * * *
* * * * *
2.一个人爬楼梯,
每次爬2级,最后余1级;
………3 ………2
…………………………
………7 ………0。 求梯的级数?

第一题:
public class no1
{
public static void main(String args[])
{
int i,j;
for(i=1;i<=5;i++){
for(j=1;j<=i;j++)
System.out.print("*");
System.out.println("");
}
}
}

对于这种不自己学习把问题拿来问的人简直不要脸。