#include <string>
string S{"111 Hiya Mia"};
size_t p,l;
S.substr(p,l); //从S的p位置开始取l长度的substring
stoi( S.substr(0,3) ); //范围int型111( int stoi (const string& str, size_t* idx = 0, int base = 10); )
to_string(i); //将int型i转换成string型;
#include <string>
string S{"111 Hiya Mia"};
size_t p,l;
S.substr(p,l); //从S的p位置开始取l长度的substring
stoi( S.substr(0,3) ); //范围int型111( int stoi (const string& str, size_t* idx = 0, int base = 10); )
to_string(i); //将int型i转换成string型;