Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement