文章

34

粉丝

0

获赞

6

访问

1.0k

头像
字符移动 题解:
P1012 贵州大学机试题
发布于2025年8月5日 19:37
阅读数 26

#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(int i = 0; i < len; i++){
		char c = s[i];
		if(c >= '0' && c <= '9') out[idx++] = c;
	}
	
	puts(out);
	
	return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发