//myfirst.cpp--displays a message #include "stdafx.h" #include <iostream> #include <set> #include <string> using namespace std; int main() { string s1 = "2147482", s2 = "-214748"; string s3 = "214748666666663", s4 = "-21474836488"; cout << stoi(s1) << endl; cout << stoi(s2) << endl; cout << atoi(s3.c_str()) << endl; cout << atoi(s4.c_str()) << endl; return 0; }
原文:https://www.cnblogs.com/Bella2017/p/11480317.html