Cod sursa(job #125861)
| Utilizator | Data | 20 ianuarie 2008 19:40:15 | |
|---|---|---|---|
| Problema | Cifra | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.56 kb |
# include <stdio.h>
# include <math.h>
# include <string.h>
long i,j,t,s,s1=0,l;
char x,y,n[200],a[]="1528392878930617065671849584345962736212374051409015283928789306170656718495843459627362123740514090";
int main ()
{
freopen ("cifra.in","r",stdin);
freopen ("cifra.out","w",stdout);
scanf("%i",&t);
for(i=1;i<=t;i++){
n[0]=0;
scanf("%s",&n);
long l;
l=strlen(n);
if(l>=2){
x=(n[l-2]-'0')*10+(n[l-1]-'0');
}
else x=n[l-1]-'0';
x=a[x-1];
printf("%i\n",x-48);
}
return 0;
}
