hbhhgghghghghg

shengboya 2023-03-08 20:10:25 2023-10-16 7:33:34 21 返回题目

#include <bits/stdc++.h>
using namespace std;
int id[101],man,woman;
char sex[101];
int main(){
	int n;
	cin>>n;
	for(int i=1; i<=n; i++){
		cin>>id[i]>>sex[i];
		if(sex[i]=='a')
			man++;
	}
	cout<<man<<endl;
	for(int i=1; i<=n; i++){
		if(sex[i]=='a')
			cout<<id[i]<<' ';
	}
	cout<<endl<<n-man<<endl;
	for(int i=1; i<=n; i++){
		if(sex[i]=='b')
			cout<<id[i]<<' ';
	}
	return 0;
}

{{ vote && vote.total.up }}