Advertisement
YavorGrancharov

MinNumber

Jan 27th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class MinNumber {
  4.     public static void main(String[] args) {
  5.         Scanner console = new Scanner(System.in);
  6.         int n = Integer.parseInt(console.nextLine());
  7.         int min = Integer.MAX_VALUE;
  8.  
  9.         for (int i = 0; i < n; i++) {
  10.             int num = Integer.parseInt(console.nextLine());
  11.             if (num < min) {
  12.                 min = num;
  13.             }
  14.         }
  15.         System.out.println(min);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement