文章

66

粉丝

0

获赞

40

访问

2.3k

头像
字符移动 题解:
P1012 贵州大学机试题
发布于2026年1月28日 14:58
阅读数 57

#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++){
		cout << str2[k];
	}
	for(int m=0;m<i;m++){
		cout << str1[m];
	}	
	return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发