Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. public class Solution
  2. {
  3.  
  4. public static void main(String[] args) throws Exception
  5. {
  6. BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  7. int a = Integer.parseInt(reader.readLine());
  8. int b = Integer.parseInt(reader.readLine());
  9. int c = Integer.parseInt(reader.readLine());
  10. int d = Integer.parseInt(reader.readLine());
  11. int e = Integer.parseInt(reader.readLine());
  12.  
  13. int minimum = min(a, b, c, d, e);
  14.  
  15. System.out.println("Minimum = " + minimum);
  16. }
  17.  
  18.  
  19. public static int min(int a, int b, int c, int d, int e)
  20. {
  21. int massive[] = {a, b, c, d, e};
  22. int min = massive[0];
  23. for (int i = 0; i != massive.length; i++) {
  24. if (min>massive[i]);
  25. min = massive[i];
  26. }
  27. return min;
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement