moltenx

Untitled

May 10th, 2014
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. import java.util.*;
  2. public class ricesack {
  3.     public static void main(String [] args) {
  4.         Scanner scn = new Scanner(System.in);
  5.         int n = scn.nextInt();
  6.         for(int y=1;y<=n;y++) {
  7.             int [] a = new int[5];
  8.             int max = 0;
  9.             for(int x=0;x<5;x++) {
  10.                 a[x] = scn.nextInt();
  11.                 if(a[x] > max)
  12.                     max=a[x];
  13.             }
  14.             System.out.println("Case #"+y+": "+max);
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment