Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class JavaApplication15 {
- //organization sucks, I know
- public static void main(String[] args) {
- Scanner stdin = new Scanner(System.in);
- int size;
- size = stdin.nextInt();
- for(int i = 1; i <= size; i++){
- for(int j = size; j>= 1; j--){
- if(j>=i){
- System.out.print(" ");
- }else{
- System.out.print("*");
- for(int ki = j; ki<= j; ki++){
- if(ki<=j)
- System.out.print("*");
- }
- }
- }
- System.out.println();
- }
- for(int i = 1; i<=size; i++){
- for(int j=1; j<=size; j++){
- if(j<i){
- System.out.print(" ");
- }
- else if(j==i || j>i){
- System.out.print("*");
- }else { //this block is not executing, and I do not know why.
- for(int ki = 1; ki<=size; ki++){ // how do I fix it?
- for(int n = size; n>=1; n--){
- if(j>=i)
- System.out.print("*");
- else
- System.out.print(" ");
- }
- System.out.println();
- }
- }
- }
- System.out.println();
- }
- for(int i = 1; i<=size; i++){ // copy of block not executing
- for(int j = size; j>=1; j--){
- if(j>=i)
- System.out.print("*");
- else
- System.out.print(" ");
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement