Skip to content

Instantly share code, notes, and snippets.

@oskimura
Created December 13, 2017 09:14
Show Gist options
  • Save oskimura/23079c5d8fa276461d0d9122f197ad5a to your computer and use it in GitHub Desktop.
Save oskimura/23079c5d8fa276461d0d9122f197ad5a to your computer and use it in GitHub Desktop.
#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