fork(1) download
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. using namespace std;
  5.  
  6. int main(){
  7. int m;
  8. cin >> m;
  9. string s = to_string(m);
  10. vector<int> arr(s.size());
  11. int j = 0;
  12. for(auto ch : s){
  13. arr[j] = ch - '0';
  14. ++j;
  15. }
  16. for(auto d : arr)
  17. cout << d;
  18. }
Success #stdin #stdout 0s 5492KB
stdin
0135
stdout
135