#include <iostream> #include <string> // 必须包含string using namespace std; int main() { int t,a2,a3,a,i,j,flag; cin>>t; while(t--) { flag=0; a2=0;a3=0; a=0; string s; cin>>s; for(int k=0;k<s.length();k++) { int digit=s[k]-'0'; a=(a+digit)%9; if(digit==2) a2++; else if(digit=...