Guest User

Untitled

a guest
Sep 12th, 2019
99
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n,A[24];
  8. ifstream f("be.be");
  9. f>>n;
  10. cout<<"n="<<n<<endl;
  11. for(int i=0;i<=n;i++)
  12. {
  13. f>>A[i];
  14. }
  15. for(int i=0;i<=n-1;i++)
  16. cout<<A[i]<<" ";
  17. cout<<endl;
  18. int k=n/2;
  19. int i=k-1;
  20. int j=k+1;
  21. while(i>=0)
  22. {
  23. if(A[i]!=A[j])
  24. {
  25. cout<<"nem szimmetrikus";
  26. return 0;
  27. }
  28. i--;j++;
  29. }
  30. cout<<"Szimmetrikus";
  31. return 0;
  32. }
RAW Paste Data