Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main()
  4. {
  5. int n, i, j, k;
  6. start:
  7. printf("Podaj n (zakres od 0 do 9): ");
  8. scanf("%d", &n);
  9. if (n<0 || n>9)
  10. {
  11. printf("Bledne n!\n");
  12. goto start;
  13. }
  14. for(i=2000;i<=4999;i++)
  15. {
  16. j=i;
  17. k=i;
  18. k=k%11;
  19. j=j/100;
  20. j=j%10;
  21. if(k==0 && n==j)
  22. printf("%d\n", i);
  23. }
  24. getch();
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement