提交时间:2022-08-03 17:07:23
运行 ID: 56942
#include<bits/stdc++.h> using namespace std; int d,g,z,n; char f,t; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>f>>t; if(f=='D')d++; if(f=='G')g++; if(f=='Z')z++; if(t=='D')d--; if(t=='G')g--; if(t=='Z')z--; }printf("D %d\nG %d\nZ %d\n",d,g,z); return 0; }