Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {  
  5.  int i,k=0,n,m=999,p=0;
  6. cin>>n;
  7. int v[100];
  8. for(i=0;i<n;i++)cin>>v[i];
  9. while(k<2)   
  10.     {  
  11. for(i=0;i<n;i++)        
  12. if(v[i]==m){p=p+1;}       
  13. if(p==0){cout<<m<<" ";k=k+1;}       
  14. p=0;       
  15. m=m-1;       
  16.      }
  17. }
  18.  
  19. Citește mai multe pe Brainly.ro - https://brainly.ro/tema/1117096#readmore
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement