Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. public class Rechteck {
  2. public static boolean isRectangular(int[][] array) {
  3. boolean b = true;
  4. for (int i = 0; i < array.length; i++) {
  5.  
  6. if (array[0].length == array[i].length) {
  7.  
  8. } else b = false;
  9.  
  10. }
  11.  
  12.  
  13. if (b == true)
  14.  
  15. {
  16. for (int i = 0; i < array.length; i++) {
  17. for (int j = 0; j < array[i].length; j++) {
  18. System.out.print(array[i][j] + ", ");
  19.  
  20.  
  21. }
  22. System.out.println();
  23. }
  24. return true;
  25.  
  26. } else {
  27. return false;
  28. }
  29. }
  30.  
  31.  
  32. public static void main(String[] args) {
  33. isRectangular(new int[3][4]);
  34.  
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement