์ƒ์„ธ ์ปจํ…์ธ 

๋ณธ๋ฌธ ์ œ๋ชฉ

[๋ฐฑ์ค€(BOJ)] 10818๋ฒˆ: ์ตœ์†Œ, ์ตœ๋Œ€ (์ž…์ถœ๋ ฅ, C++)

PROGRAMMING/Algorithm

by koharin 2021. 2. 11. 13:15

๋ณธ๋ฌธ

728x90
๋ฐ˜์‘ํ˜•

๐Ÿ’ป C++ ์ œ์ถœ์ฝ”๋“œ


  
#include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    int N;
    vector<int> v;
    scanf("%d", &N);
    for(int i=0; i<N; i++){
        int num;
        scanf("%d", &num);
        v.push_back(num);
    }
    printf("%d %d", *min_element(v.begin(), v.end()), *max_element(v.begin(), v.end()));
}

 

 

๐Ÿ‘ ๊ฒฐ๊ณผ


728x90
๋ฐ˜์‘ํ˜•

๊ด€๋ จ๊ธ€ ๋”๋ณด๊ธฐ