提交时间:2022-08-03 14:35:40

运行 ID: 56776

#include <bits/stdc++.h> using namespace std; int n,a[1000]={0}; int main(){ cin>>n; while(n--){ char x,y; x=getchar(); getchar(); y=getchar(); getchar(); a[x]--; a[y]++; } cout<<"D"<<a['D']<<endl; cout<<"G"<<a['G']<<endl; cout<<"Z"<<a['Z']; return 0; }