提交时间:2022-08-03 17:12:27

运行 ID: 56957

#include <bits/stdc++.h> using namespace std; int n,a[1000]={0}; int main(){ cin>>n; getchar(); 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; }