Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include<stdio.h>
  3. int main() {
  4. int n, i, temp, broj, cifra, obroj = 0, brojac = 0;
  5. scanf("%d", &n);
  6. if (n > 9) {
  7. for (i = n - 1; i != 0; i--) {
  8. broj = i;
  9. temp = broj;
  10. obroj = 0;
  11. while (temp != 0)
  12. {
  13. cifra = temp % 10;
  14. obroj = obroj * 10 + cifra;
  15. brojac++;
  16. temp = temp / 10;
  17. }
  18. if (obroj % brojac == 0)
  19. {
  20. printf("%d", broj);
  21. return 0;
  22. }
  23. brojac = 0;
  24. obroj = 0;
  25.  
  26.  
  27. }
  28. }
  29. else printf("Brojot ne e validen");
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement