Advertisement
Andrey_ZoZ

J

Sep 4th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. int main()
  4. {
  5.     int count;
  6.     std::cin>>count;
  7.     count=abs(count);
  8.     int find{-1};
  9.     double* massive=new double[count];
  10.     for (int index{1}; index<=count; ++index) {
  11.         std::cin>>massive[index];
  12.         if(massive[index]<2.5 and find==-1){find=index;}
  13.     }
  14.     if(find!=-1){std::cout<<find<<" "<<massive[find];}
  15.     else{std::cout<<"Not found";}
  16.    
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement