Baekjoon #20053

Baekjoon #20053

1개의 풀이 · C++

문제 원문 보기 ↗

SOLUTION INFO

C++ · main.cpp

main.cpp
#include<bits/stdc++.h>

using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t; cin >> t;
    while(t--){
        int n; cin >> n;
        int max_value = -1000001, min_value = 1000001;
        for(int i=0;i<n;i++){
            int x; cin >> x;
            if(max_value < x) max_value = x;
            if(min_value > x) min_value = x;
        }
        cout << min_value << ' '  << max_value << '\n';
    }

    return 0;
}

SOLUTION DESCRIPTION

풀이 설명

등록된 풀이 설명이 없습니다.