首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
Jun_
2026年1月23日 14:08
字符移动 题解:C++
P1012
回复 0
|
赞 6
|
浏览 414
#include<stdio.h> #include <iostream> #include<math.h> #include <stdlib.h> #include <string> #include<cctype> #include<algorithm> using namespace std; int main () { string str,num; getl...
bro
2026年1月19日 15:04
字符移动 题解:c++ 直接用string,算取巧吗
P1012
回复 0
|
赞 8
|
浏览 452
#include <bits/stdc++.h> using namespace std; int main() { string s,a,b; cin >> s; for(int i = 0; i < s.size(); i++){ if(s[i]>='0' && s[i]<='9') ...
hjkl
2026年1月16日 19:32
字符移动 题解:
P1012
回复 0
|
赞 0
|
浏览 343
#include<iostream> #include<string> int main(){ std::string str,front,back; std::cin>> str; for(auto c:str){ if('0'<=c && c<='9'...
hjkl
2026年1月16日 19:32
字符移动 题解:
P1012
回复 0
|
赞 0
|
浏览 164
#include<iostream> #include<string> int main(){ std::string str,front,back; std::cin>> str; for(auto c:str){ if('0'<=c && c<='9'...
无名1
2025年9月2日 16:43
字符移动 题解:C++
P1012
回复 0
|
赞 11
|
浏览 1.2k
#include<bits/stdc++.h> using namespace std; int main(){ int n=0,m=0; char num[120],lin[120]; string s; cin>>s; for(int i=0;i<s.length();i++){ if(s[i]>=48&&s[i]<=57){ num[n]=s[i]; n++; }else{ lin[m]=s[i]; m++; } } for(int i...
cczz
2025年8月5日 19:37
字符移动 题解:
P1012
回复 0
|
赞 9
|
浏览 772
#include<bits/stdc++.h> using namespace std; int main(){ char s[105]; char out[105]; gets(s); int idx = 0; int len = strlen(s); for(int i = 0; i < len; i++){ char c = s[i]; if(c >= '0' && c <= '9') continue; else out[idx++] = c; } for...
波耶菠萝蜜
2025年7月24日 10:43
字符移动 题解:
P1012
回复 0
|
赞 11
|
浏览 1.0k
注意a[i]和ASCII的比较是 a[i]?'a', a[]不得加'',编译应该会自动转化 #include <stdio.h> #include <string.h> int main(){ char a[100]; scanf("%s",a); int len = strlen(a); for (int i =...
leo110
2025年5月7日 14:11
字符移动 题解:利用两个char向量来完成
P1012
回复 0
|
赞 5
|
浏览 1.5k
#include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; int main(){ string str; //用两个向量分别来接收数字和非数字 vector<char> a,b; cin>>str; &n...
yb5942
2025年3月21日 16:00
字符移动 题解:
P1012
回复 0
|
赞 12
|
浏览 1.8k
#include <bits/stdc++.h> using namespace std; int main() { char arr[150]={0}; cin>> arr; char c[150]={0},f[150]={0}; int i=0,j=0,k=0; while (arr[i]!=0){ &nb...
sprite127
2025年3月17日 13:26
字符移动 题解:
P1012
回复 0
|
赞 15
|
浏览 1.9k
解题思路 分离字符: 遍历字符串,将字符分为两类: 非数字字符(字母、符号等)。 数字字符('1' 到 '9')。 存储字符: 使用两个字符串 nonDigits 和 digits 分别存储非数字字符和数字字符。 合并结果: 将 nonDigits 和 digits 按顺序合并,得到最终结果。 输出结果: ...
1
2
3
4
...
7
题目
字符移动
题解数量
70
发布题解
在线答疑
热门题解
1
字符移动 题解:
2
字符移动 题解:C
3
字符移动 题解:
4
字符移动 题解:
5
字符移动 题解:
6
字符移动 题解:
7
字符移动 题解:
8
字符移动 题解:
9
字符移动 题解:简洁版
10
字符移动 题解: