Advertisement
vencinachev

Untitled

Jan 27th, 2021
1,196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.24 KB | None | 0 0
  1. bool found = false;
  2.    int i = 2021, j = 0;
  3.    while (i >= 0)
  4.    {
  5.        if (arr[i] + arr[j] == 2021)
  6.        {
  7.            found = true;
  8.        }
  9.        else
  10.        {
  11.            i--;
  12.            j++;
  13.        }
  14.    }
  15.    cout << found;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement