rengetsu

ProcedurProgramavimas_2.04

Mar 12th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int n, z[11], address=-1000001, d=0;
  6. cin>>n;
  7. for(int i=0;i<n;i++)
  8. {
  9. cin>>z[i];
  10. if(z[i]<0)
  11.     {
  12.     if(z[i]>address)
  13.     {
  14.     address=z[i];
  15.     d=i+1;
  16.     }
  17.     }
  18.  
  19. }
  20. if(d==0)
  21. {cout<<"NERA"<<endl;}else{cout<<d<<endl;}
  22. return 0;
  23. }
Add Comment
Please, Sign In to add comment