Advertisement
STANAANDREY

T_11/4/2019

Apr 11th, 2019
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.  
  7. float v[1000];
  8. unsigned n,i,st,dr;
  9.  
  10. cout<<"n=";cin>>n;
  11. for (i=0;i<n;i++)
  12.     cin>>v[i];
  13. st=0;dr=n-1;
  14.     while (st<dr)
  15.     {
  16.       if ((int)v[st]==(int)v[dr])
  17.         cout<<v[st]<<' '<<v[dr]<<endl;
  18.         st++;
  19.         dr--;
  20.     }
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement