Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool found = false;
- int i = 2021, j = 0;
- while (i >= 0)
- {
- if (arr[i] + arr[j] == 2021)
- {
- found = true;
- }
- else
- {
- i--;
- j++;
- }
- }
- cout << found;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement