daily pastebin goal
68%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int funkcija(int polje[]) {
  2.     int max = polje[0], produkt, produkt1, x, y;
  3.     for (int i = 0; i < sizeof(polje); i++) {
  4.         if (polje[i] > max) {
  5.             max = polje[i];
  6.         }
  7.     }
  8.     do {
  9.         y = max % 10;
  10.         produkt *= x;
  11.         max /= 10;
  12.     } while (max % 10 != max);
  13.     for (int i = 0; i < sizeof(polje); i++) {
  14.         do{
  15.             x = polje[i] % 10;
  16.             produkt1 *= x;
  17.             polje[i] /= 10;
  18.         } while (polje[i] % 10 != polje[i]);
  19.         if (produkt == produkt1) {
  20.             return 1;
  21.         }
  22.     }
  23.     return 0;
  24. }
  25. int main(void) {
  26.     srand(2018);
  27.     long int polje;
  28.     polje = (long int*)malloc(204);
  29.     for (int i = 0; i < sizeof(polje); i++) {
  30.         polje[i] = (rand() % 1500) - 750;
  31.     }
  32.     printf("%d", funckija(polje));
  33.     system("pause");
  34.     return 0;
  35. }
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