SHARE
TWEET

Untitled

a guest May 19th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class TriangleOfNumbers {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int number = Integer.parseInt(scanner.nextLine());
  8.  
  9.         for (int i = 1; i <=number ; i++) {
  10.             for (int j = 0; j <i ; j++) {
  11.                 System.out.print(i+" ");
  12.             }
  13.             System.out.println();
  14.         }
  15.     }
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top