题解 1196: 去掉空格(c语言) 摘要:本题关键在于输入字符串的行数未知,这里用用while(gets(str[i]))来控制,当正确输入时while会一直循环下去,直到输入完成。 ```c #include int main() …… 题解列表 2023年03月04日 0 点赞 0 评论 143 浏览 评分:0.0
去掉空格 使用c++stl容器求解 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<vector>#include<string>using namespace std;int main(){ vec…… 题解列表 2023年03月12日 0 点赞 0 评论 132 浏览 评分:0.0
c语言字符串去掉空格 摘要:```c #include #include void f(char a[100]); int main() { char a[100],b[100],c[100],d[100]; …… 题解列表 2023年04月21日 0 点赞 0 评论 180 浏览 评分:0.0
去掉空格(c语言代码) 摘要:```c #include #include void removeblank(char* s); int main() { char strs[101] = { 0 }; wh…… 题解列表 2023年04月28日 0 点赞 0 评论 230 浏览 评分:9.9
C++ string类: 去掉空格 摘要:# 输出不带空格即可 ```c++ #include #include using namespace std; int main() { string s; wh…… 题解列表 2023年06月05日 0 点赞 0 评论 192 浏览 评分:0.0
优质题解 去掉空格(C语言 精简!) 摘要:解题思路: 利用gets()返回值(非0为真)作为while循环条件解决多行输出问题利用指针变量p对字符串进行遍历,到\0停止遍历注意事项: *++p!='\0' 是先执行++…… 题解列表 2023年07月30日 0 点赞 3 评论 1509 浏览 评分:8.3
去掉空格(处理多个空格相连) 摘要:解题思路: 用循环加gets分段收取输入,将空格后元素前移覆盖空格 注意事项: 注意考虑多个空格相连的情况 参考代码: ```c #include #include int main(…… 题解列表 2023年08月28日 0 点赞 0 评论 167 浏览 评分:0.0
C语言简单易懂 摘要:解题思路:是空格跳过,不是空格输出!!!注意事项:参考代码:#include <stdio.h>int main (){ char a[100]; while (gets(a)){ …… 题解列表 2023年09月12日 0 点赞 0 评论 231 浏览 评分:9.9
去掉空格(c语言) 摘要:解题思路:多个输入可用while循环,每次输入用for循环遍历字符串去掉空格,再输出换行符,接着输入第二个字符串,如此反复注意事项:参考代码:#include<stdio.h>#include<str…… 题解列表 2023年10月12日 0 点赞 0 评论 115 浏览 评分:0.0
编写题解 1196: 去掉空格 摘要:解题思路:注意事项:参考代码:#include<stdio.h>void f(char a[100]){ int i=0,k=0; while(a[i]!='\0') { if(a…… 题解列表 2023年11月15日 0 点赞 0 评论 143 浏览 评分:0.0