Created
December 13, 2017 09:14
-
-
Save oskimura/23079c5d8fa276461d0d9122f197ad5a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <functional> | |
#include <numeric> | |
int main() | |
{ | |
int n; | |
std::cin >> n; | |
std::vector<int> v; | |
for (int i=0;i<n;i++) { | |
int num; | |
std::cin >> num; | |
v.push_back(num); | |
} | |
std::cout << *std::min_element(v.begin(),v.end()) | |
<< " " << *std::max_element(v.begin(),v.end()) | |
<< " " << std::accumulate(v.begin(),v.end(),0) | |
<< std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment