Skip to content

Instantly share code, notes, and snippets.

@Vilsol
Created December 27, 2014 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vilsol/8d7852140e0ded992586 to your computer and use it in GitHub Desktop.
Save Vilsol/8d7852140e0ded992586 to your computer and use it in GitHub Desktop.
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