Advertisement
KeeJayBe

PROG1: oef5

Nov 21st, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.95 KB | None | 0 0
  1. /*
  2.  * KK    KK  JJJJJJJJJJ  BBBBBBBB
  3.  * KK  KK            JJ  BB      BB
  4.  * KKKK              JJ  BBBBBBBB
  5.  * KK  KK    JJ      JJ  BB      BB
  6.  * KK    KK    JJJJJJ    BBBBBBBBBB
  7.  *
  8.  * Copyright 2018 Jordy Van Kerkvoorde
  9.  */
  10. package h7;
  11.  
  12. import java.util.Scanner;
  13.  
  14. /**
  15.  *
  16.  * @author KeeJayBe
  17.  */
  18. public class Oefening5 {
  19.     public static void main(String[] args) {
  20.         Scanner s = new Scanner(System.in);
  21.         int [][] lijst = new int[3][];
  22.         for(int i = 0; i < lijst.length ; i++){
  23.         System.out.println("Geef het aantal kolommen voor rij " + (i+1) + ": ");
  24.         int a = s.nextInt();
  25.             lijst[i] = new int[a];
  26.         }
  27.  
  28.         //beter een enhanced for gebruiken ipv mijn gewone for maar het werkt wel
  29.         for(int i = 0; i < lijst.length; i++){
  30.             for(int j = 0; j < lijst[i].length; j++){
  31.             System.out.print("item\t");
  32.             }      
  33.             System.out.println("");
  34.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement