题解 | 截取字符串
截取字符串
https://www.nowcoder.com/practice/a30bbc1a0aca4c27b86dd88868de4a4a
#include <iostream>
using namespace std;
int main() {
string s;
int n;
cin >> s >> n;
cout << s.substr(0, n);//--------从索引0开始截取长为n的字串
}
// 64 位输出请用 printf("%lld")
#写题解领奖励#