Cod sursa(job #229670)

Utilizator ValentinagroPandichie Anton-Valentin Valentinagro Data 11 decembrie 2008 01:56:00
Problema Cifra Scor 0
Compilator c Status done
Runda Arhiva de probleme Marime 0.55 kb
#include<stdio.h>
#include<string.h>

int test()
{
    char s1[2],s[100];
    int i,res,n;
    gets(s);
    n=strlen(s);
    s1[0]=s[n-2];
    s1[1]=s[n-1];
    n=atoi(s1);
    if (n==0) return 0;
    i=n/20;
    n=n%20;
    if (n==0) return (4%i/10); 
    return n;
}

int main()
{
      int i,T;
      freopen("fact.in","r",stdin);    
      freopen("fact.out","w",stdout);    
      scanf("%d",&T);
      for (i=0;i<T;i++)
          printf("%d \n",test()); 
      fclose(stdin);    
      fclose(stdout);   
      return 0;    
}