fork(1) download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. /*
  5.   t is test case
  6. r = last number
  7. x = x /10 {123 ke 12 kore }
  8.   */
  9. int x, r, i, t;
  10. scanf("%d", &t);
  11. for(i = 1; i <= t; i++)
  12. {
  13.  
  14. scanf("%d", &x);
  15. while(x > 0)
  16. {
  17. r = x % 10;
  18. printf("%d ", r);
  19. x = x / 10;
  20.  
  21. }
  22. printf("\n");
  23. }
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. return 0;
  35. }
  36.  
Success #stdin #stdout 0s 5516KB
stdin
2
123
456
stdout
3 2 1 
6 5 4