文章

76

粉丝

0

获赞

277

访问

14.6k

头像
字符分类 题解:
P1016 兰州大学/贵州大学机试题
发布于2026年2月6日 11:39
阅读数 119

#include<iostream>

using namespace std;

int main() {
	
	string s;
	getline(cin, s);
	
	string num, alp, other;
	
	for (auto c : s) {
		if (isdigit(c)) num += c;
		else if (isalpha(c)) alp += c;
		else other += c;
	}
	
	cout << alp << endl << num << endl << other << endl;
	
	return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发