View Code of Problem 8

#include<stdio.h>
#include<string.h>
int main()
{
int n,i,m,k,a[10]={287,294,286,293,293,293,293,293,294,294};
char s[10];
scanf("%d\n",&n);
while(n--)
{
   gets(s);
   m=strlen(s);
   k=s[m-1]-'0';
   printf("%d\n",a[k]);
}
}

Double click to view unformatted code.


Back to problem 8