java编程输出星号
*.*.*..*..*..*...*...*...*...*....*....*....*....*....*.....*.....*.....*.....*.....*...
*.*.
*..*..*..
*...*...*...*...
*....*....*....*....*....
*.....*.....*.....*.....*.....*.....
*......*......*......*......*......*......*......
*.......*.......*.......*.......*.......*.......*.......*.. 展开
*..*..*..
*...*...*...*...
*....*....*....*....*....
*.....*.....*.....*.....*.....*.....
*......*......*......*......*......*......*......
*.......*.......*.......*.......*.......*.......*.......*.. 展开
2个回答
展开全部
public class PrintStar {
public static void main(String[] args) {
// TODO, add your application code
for(int row=0;row<7;row++){ //输出数字
for(int star=0;star<=row+1;star++){
System.out.print("*");
for(int space=0;space<=row;space++){ //输出空格
System.out.print(".");
}
}
System.out.println();
}
}
}
看这代码写的多好,不用我可生气呢
public static void main(String[] args) {
// TODO, add your application code
for(int row=0;row<7;row++){ //输出数字
for(int star=0;star<=row+1;star++){
System.out.print("*");
for(int space=0;space<=row;space++){ //输出空格
System.out.print(".");
}
}
System.out.println();
}
}
}
看这代码写的多好,不用我可生气呢
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
public class Star {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i=1;i<=7;i++){
for(int j=0;j<=i;j++){
System.out.print("*");
for(int k=0;k<i;k++){
System.out.print(".");
}
}
System.out.print("\n");
}
}
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i=1;i<=7;i++){
for(int j=0;j<=i;j++){
System.out.print("*");
for(int k=0;k<i;k++){
System.out.print(".");
}
}
System.out.print("\n");
}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询