Untitled

mail@pastecode.io avatar
unknown
pascal
2 years ago
246 B
3
Indexable
Never
uses crt;
var t,i:byte;
    n:ansistring;
    j,s:longint;
begin
	readln(t);
	for i:=1 to t do
	begin
		s:=0;
		readln(n);
		for j:=1 to length(n) do
			s:=s+ord(n[j])-48;
	if s mod 9=0 then writeln('Yes')
		else writeln('No');
	end;
	readln
end.