提交时间:2022-08-03 14:32:34
运行 ID: 56762
#include<bits/stdc++.h> using namespace std; int n,d,g,z; char a,b; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>a>>b; if(a=='D') d++; if(a=='G') g++; if(a=='Z') z++; if(b=='D') d--; if(b=='G') g--; if(b=='Z') z--; } cout<<"D"<<" "<<d<<endl<<"G"<<" "<<g<<endl<<"Z"<<" "<<z<<endl; return 0; }