-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQ10818.java
More file actions
30 lines (28 loc) Β· 898 Bytes
/
Q10818.java
File metadata and controls
30 lines (28 loc) Β· 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* Date: 2018. 9. 11.
* Author: inhyuck | https://github.com/inhyuck
* Solution URL: https://github.com/skhucode/skhucode-inhyuck
* Title: μ΅μ, μ΅λ
* Problem: Nκ°μ μ μκ° μ£Όμ΄μ§λ€. μ΄ λ, μ΅μκ°κ³Ό μ΅λκ°μ ꡬνλ νλ‘κ·Έλ¨μ μμ±νμμ€.
* URL: https://www.acmicpc.net/problem/10818
*/
package io.inhyuck.io;
import java.util.Scanner;
public class Q10818 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int num;
int maxNum = -1000000, minNum = 1000000;
for (int i = 0; i < n; i++) {
num = scanner.nextInt();
if (num > maxNum) {
maxNum = num;
}
if( num < minNum) {
minNum = num;
}
}
System.out.printf("%d %d", minNum, maxNum);
}
}