提交时间:2022-08-03 17:10:47

运行 ID: 56952

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