大神请用Java语言打出来
2个回答
展开全部
package image;
public class Car
{
public static void main ( String[] args )
{
for ( int i = 1; i < 6; i++ )
{
for ( int j = 0; j < 5 - i; j++ )
{
System.out.print (" ");
}
for ( int j = 1; j <= i; j++ )
{
System.out.print (i + " ");
}
System.out.println ();
}
}
}
public class Car
{
public static void main ( String[] args )
{
for ( int i = 1; i < 6; i++ )
{
for ( int j = 0; j < 5 - i; j++ )
{
System.out.print (" ");
}
for ( int j = 1; j <= i; j++ )
{
System.out.print (i + " ");
}
System.out.println ();
}
}
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
public class Demo {
public static void main(String[] args) {
int i, j;
for (i = 1; i <= 5; i++) {
for (j = 1; j <= (5*2-1-(i * 2 - 1))/2; j++)
System.out.print(" ");
for (j = 1; j <= i; j++){
System.out.print(i);
System.out.print(" ");
}
for (j = 1; j <= (5*2-1-(i * 2 - 1))/2-1; j++)
System.out.print(" ");
System.out.println();
}
}
}
public static void main(String[] args) {
int i, j;
for (i = 1; i <= 5; i++) {
for (j = 1; j <= (5*2-1-(i * 2 - 1))/2; j++)
System.out.print(" ");
for (j = 1; j <= i; j++){
System.out.print(i);
System.out.print(" ");
}
for (j = 1; j <= (5*2-1-(i * 2 - 1))/2-1; j++)
System.out.print(" ");
System.out.println();
}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询