fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. int main() {
  5. for (int i : {1, -1, 2, 1000000000} ) {
  6. std::string s = std::to_string(i);
  7. std::cout << i << " == " << s << std::endl;
  8. }
  9. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
1 == 1
-1 == -1
2 == 2
1000000000 == 1000000000