josiftepe

Untitled

Oct 25th, 2020
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int dolzina;
  8.  
  9.     cin>>dolzina;
  10.     int niza[dolzina];
  11.     int i;
  12.  
  13. int najmal=1000;
  14.    
  15.  
  16. for(i=0; i<dolzina; i+=1){
  17.    cin>>niza[i];
  18.     if(najmal>niza[i]){
  19.         cout << najmal << " " << niza[i] << endl;
  20.       najmal=niza[i];
  21.     }
  22. }
  23.  cout<<najmal << endl;
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment