變數要設定多一點
#include <iostream>
#include <string>
using namespace std;
int main()
{
int a, b, d=0, e=0, f=0;
cin>>a;
for(int c=0;c<a;c++){
cin>>b;
if(b%3==0)
d+=1;
else if(b%3==1)
e+=1;
else
f+=1;
}
cout<<d<<" "<<e<<" "<<f;
return 0;
}