View Code of Problem 8

#include <iostream>
using namespace std;
int main(void){
	int n;
	char c[7];
	cin>>n;
	while(n--){
		cin>>c;
		if(c[6]=='9'||c[6]=='1'||c[6]=='8')
			cout<<"294"<<endl;
		else if(c[6]=='3'||c[6]=='4'||c[6]=='5'||c[7]=='6'||c[7]=='7') 
			cout<<"293"<<endl;
		else if(c[6]=='0')
			cout<<"287"<<endl;
		else
			cout<<"286"<<endl;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 8