View Code of Problem 8

#include<stdio.h>
#include<string.h>
int main(){
	int n,m,y=365;
	char s[10];
	scanf("%d",&n);
	while(n--){
		gets(s);
		m=strlen(s);
		switch(s[m-1]){
			case '0':y-=78;break;
			case '1':y-=71;break;
			case '2':y-=79;break;
			case '8':y-=71;break;
			case '9':y-=71;break;
			default: y-=72;break;
		}
		printf("%d\n",y);
		
	}
}

Double click to view unformatted code.


Back to problem 8