fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, del = 10;
  6. cin >> n;
  7. for (int i = 0; i < 10; ++i){
  8. cout << n % del << endl;
  9. n = n / 10;
  10. }
  11. return 0;
  12. }
Success #stdin #stdout 0.01s 5320KB
stdin
1223456789
stdout
9
8
7
6
5
4
3
2
2
1