Pagini recente » Cod sursa (job #244155) | Cod sursa (job #1493438) | Cod sursa (job #813539) | Cod sursa (job #2494424) | Cod sursa (job #17380)
Cod sursa(job #17380)
#include<stdio.h>
#include<string.h>
char cif[]="1528392877847384154459627362112817285988930617065562516293223740514099069506376671849584334039407100";
int main(void)
{
freopen("cifra.in","r",stdin);
freopen("cifra.out","w",stdout);
int t,i,j,nr;
char n[101],s[3];
scanf("%d",&t);
for(i=1;i<=t;i++)
{
scanf("%s",n);
if(strlen(s)>2)
strcpy(s,n+strlen(n)-2);
else strcpy(s,n);
nr=0;
for(j=0;j<strlen(s);j++)
nr=10*nr+s[j]-'0';
if(!nr) nr=100;
nr--;
printf("%c\n",cif[nr]);
}
fclose(stdin);
fclose(stdout);
return 0;
}