daily pastebin goal
23%
SHARE
TWEET

zadatak

a guest Mar 26th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int provera(int niz[], int k, int n) {
  2.     int povracaj = 0;
  3.     for (int i = 0; i < n; i++)
  4.     {
  5.         for (int  j = i+1; j < n; j++)
  6.         {
  7.             if (abs(niz[i] - niz[j]) == k) {
  8.                 povracaj = 1;
  9.                 break;
  10.             }
  11.         }
  12.     }
  13.     return povracaj;
  14. }
  15. int main(void) {
  16.    
  17.     int niz[10] = { 5,10,6,4,3 };
  18.     int n = 5;
  19.     int k = 0;
  20.     provera(niz, k, n) ? printf("Da") : printf("NE");
  21.  
  22.     return 0;
  23. }
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