我坚持使用 for 循环在第二行末尾制作符号,我尝试了几次但仍然无法正常工作。有人能告诉我哪里做错了吗?
////////////////\\\\\\\\\\\\\\\\
////////////********
////////****************
////************************
********************************
它应该看起来像这样:
////////////////\\\\\\\\\\\\\\\\
////////////********\\\\\\\\\\\\
////////****************\\\\\\\\
////************************\\\\
********************************
这是我的代码:
public static void main (String [] args){
for (int lineOne=1; lineOne<=16; lineOne += 2){
System.out.print("//");
}
for (int lineOne=1; lineOne<=32; lineOne += 2){
System.out.print("\\");
}
System.out.println("");
for (int a=8; a<=32; a += 8)
{
for (int b=12; b < (28 - a / 2); b +=2)
{
System.out.print("//");
}
for (int c=0; c<a; c++)
{
System.out.print("*");
}
System.out.println("");
}
}