fork(2) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4.  
  5. int main()
  6. {
  7. std::vector<int> v;
  8. std::string number;
  9. std::cin >> number;
  10. for(auto& Integer: number)
  11. v.push_back(static_cast<int>(Integer - '0'));
  12.  
  13. for(const auto& it: v) std::cout << it << " ";
  14. }
  15.  
Success #stdin #stdout 0s 4268KB
stdin
123456789987654321
stdout
1 2 3 4 5 6 7 8 9 9 8 7 6 5 4 3 2 1