BOJ 2587 대표값2

1 개요[ | ]

BOJ 2587 대표값2


2 C++[ | ]

#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int arr[5];
    for(int i=0; i<5; i++) {
        cin >> arr[i];
    }
    int sum = 0;
    for(int i=0; i<5; i++) {
        sum += arr[i];
    }
    sort(arr, arr+5);
    cout << sum/5 << '\n';
    cout << arr[2] << '\n';
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}