首页
DreamJudge
院校信息
专业题库
模拟考试
机试真题
上岸课程
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
yb5942
2025年3月21日 16:00
字符移动 题解:
P1012
回复 0
|
赞 5
|
浏览 174
#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
|
赞 10
|
浏览 225
解题思路 分离字符: 遍历字符串,将字符分为两类: 非数字字符(字母、符号等)。 数字字符('1' 到 '9')。 存储字符: 使用两个字符串 nonDigits 和 digits 分别存储非数字字符和数字字符。 合并结果: 将 nonDigits 和 digits 按顺序合并,得到最终结果。 输出结果: ...
cc12345
2025年3月16日 20:40
字符移动 题解:(假)冒泡排序法
P1012
回复 0
|
赞 3
|
浏览 149
#include< bits/stdc++.h> using namespace std; int main() { string s; getline(cin,s); int len=s.length(); for(int i=0;i<len-1;i++) { for(int j=0;j<len-1;j++) { if(!isdigit(s[j+1])&&isdigit(s[j]) ) { swap(s[j],s[j+1]); } } } for(char c:s) cout<<c; }
阿灿
2025年3月15日 03:46
字符移动 题解:
P1012
回复 0
|
赞 3
|
浏览 176
#include<bits/stdc++.h> using namespace std; int main(){ string tmp; int n,i; cin>>tmp; string ans,num,aws; n = tmp.length(); while(n--){ if(tmp[n]>='0'&&tmp[n]<='9'){ num.push_back(tmp[n]); }else{ ans.push_back(tmp[n]); } } n = ans.l...
山崎友希
2025年3月11日 00:10
字符移动 题解:
P1012
回复 0
|
赞 12
|
浏览 213
#include<stdio.h> #include<string.h> #define maxsize 100 int main(){ char string[maxsize];//数组A用于存除了数字外的一切东西 char A[maxsize],B[maxsize];//数组B存数字 scanf("%s",string); int length=strlen(str...
homelesspear
2025年3月9日 16:46
字符移动 题解:
P1012
回复 0
|
赞 10
|
浏览 230
两次遍历,分别将非数字字符输出一次,将数字字符输出一次,简单易懂。或者搞两个数组,一次遍历分别筛选,写出来有点多,就用这个了。 #include<stdio.h> #include<string.h> int main(){ char arr[100]; scanf("%s",arr); int len=strlen(arr); for(int i=0;i<len;i++...
kaikai
2025年1月28日 23:51
字符移动 题解:
P1012
回复 0
|
赞 27
|
浏览 673
#include<bits/stdc++.h> using namespace std; int main() { string a; cin>>a; string b; for (int i = 0; i < a.size(); ++i) { if(!(a[i]>='0' && a[i]<='9')){ b+=a[i]; } } for (int i = 0; i &l...
MEGURI
2025年1月12日 09:57
字符移动 题解:
P1012
回复 0
|
赞 10
|
浏览 471
#include<stdio.h> int main() { int i = 0; int j = 0; int k = 0; int u = 0; char a[100]; char b[100]; char c[100]; for(i = 0...
hellokitty1679
2024年9月8日 15:18
字符移动 题解:C
P1012
回复 0
|
赞 20
|
浏览 1.1k
#include<stdio.h> #include<string.h> int main(void) { char a[100]; char b[100],c[100]; int m=0,n=0; scanf("%s",a); for (int i=0;i<strlen(a);i++) {&nb...
ccccccyes
2024年9月3日 10:23
字符移动 题解:
P1012
回复 0
|
赞 15
|
浏览 1.8k
//03/09/24 10:15 //03/09/24 10:23 #include <iostream> using namespace std; int main(){ string str,str1,str2; getline(cin,str); for(int i = 0; i<=str.size()-1; i++){ if(str[i]>='0'&&str[i]<='9'){ str2.append(1,str[i]); } else{ str1.append(1,st...
1
2
3
...
6
题目
字符移动
题解数量
52
发布题解
在线答疑
热门题解
1
字符移动 题解:
2
字符移动 题解:C
3
字符移动 题解:
4
字符移动 题解:简洁版
5
字符移动 题解:
6
字符移动 题解:
7
字符移动 题解:
8
字符移动 题解:
9
题解:字符移动
10
字符移动 题解: