题解 | #截取字符串#
截取字符串
http://www.nowcoder.com/practice/a30bbc1a0aca4c27b86dd88868de4a4a
简洁代码
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
int k;
cin >> s >> k;
cout << s.substr(0, k);
return 0;
}
截取字符串
http://www.nowcoder.com/practice/a30bbc1a0aca4c27b86dd88868de4a4a
简洁代码
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
int k;
cin >> s >> k;
cout << s.substr(0, k);
return 0;
}
相关推荐