Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int a,b;
  6. int posledenBroj;
  7. int prvBroj;
  8. int proizvod = 1;
  9. int temp,temp1;
  10. scanf("%d%d",&a,&b);
  11. int i;
  12. int brojac = 0;
  13. for(i=a;i<b;i++)
  14. {
  15. temp = i;
  16. posledenBroj = temp%10;
  17. temp/=10;
  18. while(temp>9)
  19. {
  20. temp1 = temp%10;
  21. proizvod*=temp1;
  22.  
  23. prvBroj = temp;
  24.  
  25. temp/=10;
  26.  
  27. }
  28.  
  29. if((prvBroj*10 + posledenBroj) % prozvod == 0)
  30. {
  31. int temp3 = (prvBroj*10 + posledenBroj) / prozvod;
  32. printf("%d -> (%d == %d * %d",i,prozvod,temp3);
  33. broj++;
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement