Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. case 8:
  2. option = 'H';
  3. {
  4. int arr1[SIZE];
  5. int arr2[SIZE];
  6. bool identicalValues;
  7. cout << "Hello, please enter " <<SIZE<< " numbers --> ";
  8. for (int i=0 ; i < SIZE-1 ; i++)
  9. cin >> arr1[i];
  10. cout << "\n";
  11. cout << "Now, please enter more " <<SIZE<< " numbers --> ";
  12. for (int j=0 ; j < SIZE ; j++)
  13. cin >> arr2[j];
  14. cout << "\n";
  15. for(int i = 0, j=0; j < SIZE; i++, j++)
  16. {
  17. if (arr1[i] == arr2[j+1] && arr1[SIZE] == arr2[j])
  18. {
  19. identicalValues = true;
  20. }
  21. else
  22. {
  23. identicalValues = false;
  24. }
  25. if (identicalValues == false)
  26. {
  27. break;
  28. }
  29. }
  30. if (identicalValues == true)
  31. {
  32. cout << "True";
  33. cout << "\n";
  34. }
  35. else
  36. {
  37. cout << "False";
  38. cout << "\n";
  39. }
  40. system("pause");
  41. system("CLS");
  42. }
  43. break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement