bai 1 - hsg9 vinhphuc 2021

20/04/2023

http://chuyentin.pro/

Code
#include <bits/stdc++.h>
using namespace std;

string solve(string s) {
	long long sum=0;
	for (int i=0;i < s.length(); i++) sum += (s[i] - '0');
	if (sum%9==0) return "Yes";
	else return "No";
	
}

int main(){
	string s;
	int t;
	cin >> t;
	while (t--) {
		cin >> s;
		cout << solve(s) << endl; 
	}
	return 0;
}