Robert_Manea

permutari spre stanga

Nov 12th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int n,i;
  7. scanf("%d",&n);
  8. int contor=0;
  9. int nc=n;
  10. while(nc!=0){
  11. nc=nc/10;
  12. contor++;
  13. }
  14. for(i=1;i<=contor;i++){
  15. int x=0;
  16. int ordin=1;
  17. while(n>9){
  18. int c=n%10;
  19. x=x+c*ordin;
  20. ordin=ordin*10;
  21. n=n/10;
  22. }
  23. x=x*10+n;
  24. printf("%d",x);
  25. n=x;
  26. printf("\n");
  27. }
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment