Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int funkcija(int polje[]) {
- int max = polje[0], produkt, produkt1, x, y;
- for (int i = 0; i < sizeof(polje); i++) {
- if (polje[i] > max) {
- max = polje[i];
- }
- }
- do {
- y = max % 10;
- produkt *= x;
- max /= 10;
- } while (max % 10 != max);
- for (int i = 0; i < sizeof(polje); i++) {
- do{
- x = polje[i] % 10;
- produkt1 *= x;
- polje[i] /= 10;
- } while (polje[i] % 10 != polje[i]);
- if (produkt == produkt1) {
- return 1;
- }
- }
- return 0;
- }
- int main(void) {
- srand(2018);
- long int polje;
- polje = (long int*)malloc(204);
- for (int i = 0; i < sizeof(polje); i++) {
- polje[i] = (rand() % 1500) - 750;
- }
- printf("%d", funckija(polje));
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement