SHARE
TWEET

Untitled

a guest Apr 20th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define MAX 100000
  2. void printPairs(int arr[], int arr_size, int sum)
  3. {
  4.   int i, temp;
  5.   bool s[MAX] = {0};
  6.   for (i = 0; i < arr_size; i++)
  7.   {
  8.       temp = sum - arr[i];
  9.       if (temp >= 0 && s[temp] == 1)
  10.          printf("sum=%d is (%d, %d) n", sum, arr[i], temp);
  11.        s[arr[i]] = 1;
  12.   }
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top