fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include<string.h>
  4.  
  5. int zamiana(int liczby)
  6. {
  7. char bufor[100];
  8. itoa(liczby,bufor,10);
  9. strrev(bufor);
  10. liczby=atoi(bufor);
  11. return liczby;
  12. }
  13.  
  14. int main()
  15. {
  16. int ile_testow, liczby;
  17. //printf("Podaj ile testow chcesz wykonac:");
  18. scanf("%d",&ile_testow);
  19. if(ile_testow<=80 && ile_testow>=1)
  20. {
  21. //printf("Podaj liczby:\n");
  22. for(int i=0; i<ile_testow; ++i)
  23. {
  24. scanf("%d",&liczby);
  25. liczby=zamiana(liczby);
  26. //printf("Liczba zamieniona to %lu\n Liczba oryginalna to %lu\n",liczby,zamiana(liczby));
  27. if(liczby==zamiana(liczby)) printf("%d 0\n",liczby);
  28. else
  29. {
  30. int ile_powtorzen=0;
  31. while(1)
  32. {
  33. ++ile_powtorzen;
  34. liczby+=zamiana(liczby);
  35. if(liczby==zamiana(liczby)) break;
  36. }
  37. printf("%d %d\n",liczby,ile_powtorzen);
  38. }
  39. }
  40. }
  41. return 0;
  42. }
  43.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘zamiana’:
prog.c:8:5: warning: implicit declaration of function ‘itoa’ [-Wimplicit-function-declaration]
     itoa(liczby,bufor,10);
     ^~~~
prog.c:9:5: warning: implicit declaration of function ‘strrev’ [-Wimplicit-function-declaration]
     strrev(bufor);
     ^~~~~~
/home/7WYzTl/ccibQ0P1.o: In function `zamiana':
prog.c:(.text+0x10): undefined reference to `itoa'
prog.c:(.text+0x1a): undefined reference to `strrev'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty