Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package tamgiaccan;
- import java.util.Scanner;
- public class TamGiacCan
- {
- public static void main(String[] args)
- {
- Scanner mk = new Scanner(System.in);
- int n= mk.nextInt();
- if(n<1|| n>100)
- {
- System.out.print("\n Erorr !!");
- }
- for(int i=0;i<n;i++)
- {
- for(int k=0;k<n-i;k++)
- {
- System.out.print(" ");
- }
- for(int t=0;t<2*i+1;t++)
- {
- System.out.print("*");
- }
- System.out.print("\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement