fork download
  1. #include <iostream>
  2. using namespace std; // consider removing this line in serious projects
  3.  
  4. int main() {
  5.  
  6. bool isReverse(int x[], int y[], int sze);
  7.  
  8. int _a[3] = {1,2,3};
  9. int _b[3] = {3,2,6};
  10. int _c = 3;
  11.  
  12. cout << isReverse(_a, _b, _c);
  13. }
  14.  
  15. bool isReverse(int x[], int y[], int sze){
  16. int num = 0;
  17. bool bng = true;
  18. for (int i=(sze-1); i >= 0; i--){
  19. if (x[num] == y[i]){
  20. bng = true;
  21. num++;}
  22. else{
  23. bng = false;
  24. num++;}
  25.  
  26. }
  27. return bng;
  28. }
Success #stdin #stdout 0s 5284KB
stdin
stdout
1