Pagini recente » Cod sursa (job #653020) | Cod sursa (job #2356368) | Cod sursa (job #2126804) | Cod sursa (job #2552351) | Cod sursa (job #17390)
Cod sursa(job #17390)
#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\n",&t);
for(i=1;i<=t;i++)
{
gets(n);
memset(s,0,sizeof(s));
if(strlen(n)>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;
}