提交时间:2022-08-03 17:01:58
运行 ID: 56931
#include<bits/stdc++.h> using namespace std; int a,b,c; int tot; char m,n; int main(){ cin>>tot; for(int i=1;i<=tot;i++){ cin>>m>>n; if(m=='D')a++; if(m=='G')b++; if(m=='Z')c++; if(n=='D')a--; if(n=='G')b--; if(n=='Z')c--; } cout<<"D"<<" "<<a<<endl; cout<<"G"<<" "<<b<<endl; cout<<"Z"<<" "<<c<<endl; return 0; }