C语言写这题不能用scanf 摘要:解题思路:注意事项:测试的数据中有空格,使用scanf不能识别空格。要使用gets或者别的支持空格的。参考代码:```c#include<stdio.h>#include&…… 题解列表 2025年08月02日 1 点赞 0 评论 126 浏览 评分:10.0
输出亲朋字符串(c++) 摘要:```cpp #include using namespace std; int main(){ string s; getline(cin,s);//此函数可读取整行,包括…… 题解列表 2022年11月06日 1 点赞 2 评论 626 浏览 评分:9.9
2850: 输出亲朋字符串 摘要:```cpp #include using namespace std; int main() { string s; getline(cin,s); char …… 题解列表 2023年01月10日 0 点赞 0 评论 318 浏览 评分:9.9
ASCII值赋值之输出亲朋字符串 摘要:```c #include #include int main() { char a[101], b[101]; //因为字符串长度最大为100,101是因为字符串最后一位是\0 ge…… 题解列表 2023年01月21日 0 点赞 0 评论 625 浏览 评分:9.9
2850: 输出亲朋字符串 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N=1e7;stri…… 题解列表 2024年07月19日 0 点赞 0 评论 529 浏览 评分:9.9
题解 2850: 输出亲朋字符串 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;char s[103];int main(){ cin.getline(s,103…… 题解列表 2024年07月12日 0 点赞 0 评论 606 浏览 评分:9.9
要注意测试案例会包括空格 摘要:解题思路:注意事项:要用gets函数,测试数据里面有空格,%s接受不了参考代码:#include<stdio.h>#include<string.h>int main(){ char a[100]; …… 题解列表 2024年04月02日 1 点赞 0 评论 487 浏览 评分:9.9
耿直思路的代码解决输出亲朋字符串 摘要:解题思路:注意事项:101参考代码:a=input()A=list(a)B=[]for i in range(len(A)): if i<len(A)-1: C=ord(A[i])+o…… 题解列表 2024年03月27日 0 点赞 1 评论 411 浏览 评分:9.9
想太多了,很简单的题搞半天 摘要:解题思路:没啥思路,就循环相加就是注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ int i,p; char s[100]…… 题解列表 2024年02月15日 0 点赞 0 评论 402 浏览 评分:9.9
编写题解 2850: 输出亲朋字符串 摘要:解题思路:设计两个移动指针count1,count2注意事项:参考代码:str=input() ls=[] #初始化空列表 count1=0 #设计两个相邻指针并初始化 count2=1 wh…… 题解列表 2022年10月28日 0 点赞 1 评论 581 浏览 评分:9.9