Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int min(int a, int b) {
- if(a < b) {
- return a;
- }
- else {
- return b;
- }
- }
- int main()
- {
- int n;
- cin >> n;
- int niza[n];
- for(int i = 0; i < n; i++) {
- cin >> niza[i];
- }
- int najmal = 2000000000;
- for(int i = 0; i < n; i++) {
- najmal = min(najmal, niza[i]);
- }
- cout << najmal << endl;
- return 0;
- }
- // 5
- // 4 3 1 2 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement