首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
codesuc
2020年3月12日 11:50
字符串的输出(附多出乱码情况处理方法)
P1012
回复 0
|
赞 0
|
浏览 12.1k
#include<stdio.h> #include<string.h> int main(){ int i,j=0; static char a[101],b[101],c;//这里开始直接用char定义,后面结果输出字符串时后面会多一些乱码出来,网上查了资料说 //是直接用char申请是auto型,变量在栈里,初始化不确定,最后一个字符后面不一定是空 //白的。所以加个static申请在静态数据区,初始化为0,...
LiW97
2020年2月3日 20:25
字符串移动函数
P1012
回复 0
|
赞 0
|
浏览 10.1k
#include<stdio.h> #include<string.h> char* move_string(char* s){ int n=strlen(s); int id_num=0; int id_oth=0; char num_s[100]={100}; char oth_s[100]={100}; for(int i=0;i<=n-1;i++){ if(s[i]>='0'&&s[i]<='9') &...
A1120161820
2020年3月19日 09:07
字符移动(c++)
P1012
回复 0
|
赞 3
|
浏览 12.7k
#include<iostream> #include<string> using namespace std; int main() { string s, s1 = "", s2 = "";//保存完整字符串、字符、数字 cin >> s; for (int i = 0; i < s.length(); i++) { if (s[i] >= '0' && s[i] <= '9') s2 += s[i]; else s1 += s[i]; } cout &...
1
...
5
6
7
题目
字符移动
题解数量
63
发布题解
在线答疑
热门题解
1
字符移动 题解:
2
字符移动 题解:C
3
字符移动 题解:
4
字符移动 题解:
5
字符移动 题解:简洁版
6
字符移动 题解:
7
字符移动 题解:
8
字符移动 题解:
9
字符移动 题解:
10
字符移动 题解:C++