首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
xsw
2026年2月3日 10:43
字符移动 题解:
P1012
回复 0
|
赞 0
|
浏览 14
#include<iostream> using namespace std; int main() { string s; cin >> s; string str; for (int i = 0; i < s.size(); i ++ ) { if (s[i] >= '0' && s[i] <= '9') { str += s[i]; } else { cout << s[i]; } } cout << str <&l...
mlx
2026年1月28日 22:49
字符移动 题解:
P1012
回复 0
|
赞 5
|
浏览 99
#include<iostream> #include<vector> using namespace std; string str; vector<char> c; int main() { cin>>str; for(int i=0;i<str.size();i++) { if(str[i]>='0'&&str[i]<='9') c.push_back(str[i]); else cout<<str[i]; } for...
yauqq
2026年1月28日 14:58
字符移动 题解:
P1012
回复 0
|
赞 2
|
浏览 56
#include<bits/stdc++.h> using namespace std; int main(){ string str; cin >> str; string str1[100]; string str2[100]; int i=0,j=0; for(char c:str){ if(c >= '0' && c <= '9') str1[i++] = c; else str2[j++] =c; } for(int k=0;k<j;k++){ ...
Jun_
2026年1月23日 14:08
字符移动 题解:C++
P1012
回复 0
|
赞 4
|
浏览 87
#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
|
赞 3
|
浏览 151
#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
|
浏览 167
#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
|
浏览 97
#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
|
赞 8
|
浏览 893
#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
|
赞 7
|
浏览 555
#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
|
赞 6
|
浏览 769
注意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 =...
1
2
3
...
7
题目
字符移动
题解数量
63
发布题解
在线答疑
热门题解
1
字符移动 题解:
2
字符移动 题解:C
3
字符移动 题解:
4
字符移动 题解:
5
字符移动 题解:简洁版
6
字符移动 题解:
7
字符移动 题解:
8
字符移动 题解:
9
字符移动 题解:
10
字符移动 题解:C++