Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Exam22 {
  4. public static void main(String[] args) {
  5. // TODO Auto-generated method stub
  6. // input 3*4 numbers and store into 2D
  7. // array A
  8. Scanner sc = new Scanner(System.in);
  9. // rowsize colsize
  10. int[][] A = new int[3][4];
  11. for (int r=0; r<3; r++) {
  12. for (int c=0; c<4; c++) {
  13. A[r][c] = sc.nextInt();
  14. }
  15. }
  16.  
  17. int max = Integer.MIN_VALUE;
  18. for (int r=0; r<3; r++) {
  19. for (int c=0; c<4; c++) {
  20. if (max<A[r][c]) {
  21. max = A[r][c];
  22. }
  23. }
  24. }
  25. System.out.println(max);
  26. // find out the biggest number inside array A
  27. //input 3*2 numbers and store into 2D array B
  28. //output col first backward
  29. //output row second backward
  30.  
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement