Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner read = new Scanner(System.in);
  6. int t = read.nextInt();
  7. int ans[] = new int[t];
  8. for (int i = 0; i < t; i++) {
  9. ans[i] = 0;
  10. int n = read.nextInt();
  11. for (int j = 0; j < n; j++){
  12. int s = read.nextInt();
  13. if (ans[i] < s) {
  14. ans[i] = s;
  15. }
  16. }
  17. }
  18. for (int i = 1; i <= t; i++) {
  19. System.out.println("Case "+i+": "+ans[i-1]);
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement