Pagini recente » Cod sursa (job #1738121) | Cod sursa (job #779066) | Cod sursa (job #1997494) | Cod sursa (job #1750178) | Cod sursa (job #1574369)
// Template v2
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<double, double> PKK;
const int NMAX = 1234567;
const int INF = int(1e9);
const LL INF64 = LL(1e18);
const LD EPS = 1e-9, PI = 3.1415926535897932384626433832795;
string s;
int solve()
{
cin>>t;
while(t--)
{
int sum=0;
getline(cin, s);
for(int i=0; i<s.size(); ++i)
sum+=s[i]-'0';
cout<<9-(sum%9)<<"\n";
}
}
int main()
{
assert(freopen("expozitie.in", "rt", stdin));
assert(freopen("expozitie.out", "wt", stdout));
solve();
return 0;
}