fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n, num, i;
  7. cin >> n;
  8. for (i=1; i<=n; i++){
  9. cin >> num;
  10. while(num != 0){
  11. cout << num%10 << ' ';
  12. num = num / 10;
  13. }
  14. cout << '\n';
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0s 5288KB
stdin
2
720
12
stdout
0 2 7 
2 1