-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9f6804
commit 105a9c7
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import java.util.*; | ||
public class Program | ||
{ | ||
public static void main(String[] args) | ||
{ | ||
Scanner scn=new Scanner(System.in); | ||
//input of number of test cases | ||
int t=scn.nextInt(); | ||
int[] arr=new int[t]; | ||
//taking input | ||
for(int i=0;i<arr.length;i++) | ||
{ | ||
arr[i]=scn.nextInt(); | ||
} | ||
//finding maximum value input to make that number of rows | ||
int max=arr[0]; | ||
for(int i=1;i<arr.length;i++) | ||
{ | ||
if(arr[i]>max) | ||
max=arr[i]; | ||
} | ||
for(int floor=max;floor>=1;floor--) | ||
{ | ||
for(int i=0;i<arr.length;i++) | ||
{ | ||
if(arr[i]>=floor) | ||
{ | ||
System.out.print("*\t"); | ||
} | ||
else | ||
System.out.print("\t"); | ||
} | ||
System.out.println(); | ||
} | ||
} | ||
} |