Created
December 27, 2014 03:19
-
-
Save Vilsol/8d7852140e0ded992586 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args){ | |
Scanner s = new Scanner(System.in); | |
String stuff = s.nextLine(); | |
String[] x = stuff.split(" "); | |
int highest = 0; | |
for(String f : x){ | |
if(Integer.parseInt(f) > highest){ | |
highest = Integer.parseInt(f); | |
} | |
} | |
for(int i = 0; i < highest; i++){ | |
String line = ""; | |
for(String l : x){ | |
if(Integer.parseInt(l) >= highest - i){ | |
line += "*"; | |
}else{ | |
line += " "; | |
} | |
} | |
System.out.println(line); | |
} | |
for(int i = highest - 1; i >= 0; i--){ | |
String line = ""; | |
for(String l : x){ | |
if(Integer.parseInt(l) >= highest - i){ | |
line += "*"; | |
}else{ | |
line += " "; | |
} | |
} | |
System.out.println(line); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment