public class programfOR {
public static void main(String[] args) {
int N = 5;
int N = 5;
for (int i = 1; i <= N; i++) {
for (int j = 1; j <= N; j++) {
if ((j == i) || (j == N+1-i))
System.out.print(“#”);
else
System.out.print(” “);
}
System.out.println();
}
}
}
for (int j = 1; j <= N; j++) {
if ((j == i) || (j == N+1-i))
System.out.print(“#”);
else
System.out.print(” “);
}
System.out.println();
}
}
}
Tags : Java, For, Program
Tidak ada komentar:
Posting Komentar