本博客主要用于记录string子串转long long类型的简便方法(STL)
long long ans=atoll(s.substr(s[i],n).c_str());//从字符串s的第i位开始,向后截取n位,所得到的长整型
解析:
s.substr(s[i],n):从字符串s的第i位开始,向后截取n位
.c_str()将substr的返回值string类型转换为const char类型,方便atoll使用
atoll:将字符串转换为long long类型(类似的还有atoi,atol)