题解 2850: 输出亲朋字符串

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

输出亲朋字符串(c++)

```cpp#includeusingnamespacestd;intmain(){strings;getline(cin,s);//此函数可读取整行,包括前导和嵌入的空格chara=s[0];//因为后面s[0]ASCII值会变,所以先用a存储s[0]原先的ASCII值intl=s.size();f

2850: 输出亲朋字符串

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;char s[10000];int main(){    cin.getline(……

题解 2850: 输出亲朋字符串

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;char s[103];int main(){ cin.getline(s,103……

2850: 输出亲朋字符串

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N=1e7;stri……

逐一处理字符即可

摘要:参考代码:#include<iostream> using namespace std;   int main() {       string s;     getline(cin, s……

输出亲朋字符串

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ string s; getline(cin,s); for(……

单个字符拼接输出

摘要:解题思路:注意事项:不要用cin<< 因为根据题目条件,字符串中可能含有空格参考代码://#include <bits/stdc++.h>#define _CRT_SECURE_NO_WARNINGS……