Advertisement
roastka

Untitled

May 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. package com.company;
  2. import java.util.Scanner;
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner console = new Scanner(System.in);
  6. int n = Integer.parseInt(console.nextLine());
  7. int sum = Integer.parseInt(console.nextLine());
  8. for(int i = 2; i <= n; i++){
  9. int sum1 = Integer.parseInt(console.nextLine());
  10. if(sum>sum1)
  11. sum = sum1;
  12. }
  13. System.out.println(sum);
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement