fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main(){
  7. auto var1 = "1234";
  8. vector<string> empty(4, "a");
  9. for (auto i = 0; i < 4; i++) empty[i] = to_string(2 * (var1[i] - '0'));
  10. for (auto x : empty) cout << x << endl;
  11. }
  12.  
  13. //https://pt.stackoverflow.com/q/433818/101
Success #stdin #stdout 0s 4300KB
stdin
Standard input is empty
stdout
2
4
6
8