View Code of Problem 8

#include <stdio.h>
#include <string.h>
#include <math.h>
int main(){
  int n;
  scanf("%d",&n);
  while(n--){
    int k,i;
    char a[1000];
    scanf("%s",a);
    k=strlen(a);
    if(a[k-1]=='1') i=71;
    if(a[k-1]=='2') i=79;
    if(a[k-1]=='3') i=72;
    if(a[k-1]=='4') i=72;
    if(a[k-1]=='5') i=72;
    if(a[k-1]=='6') i=72;
    if(a[k-1]=='7') i=72;
    if(a[k-1]=='8') i=71;
    if(a[k-1]=='9') i=71;
    if(a[k-1]=='0') i=78;
    printf("%d\n",365-i);
  }

}

Double click to view unformatted code.


Back to problem 8