View Code of Problem 8

#include<iostream>
#include <string>
using namespace std;

int main(){
	int N, num, allow, s;
	string place;
	int day[10] = {78,71,79,72,72,72,72,72,71,71};
	cin >> N;
	while(N--){
		cin >> place;
		s = place.length() - 1;
		num = place[s] - '0';
		allow = 365-day[num];
		cout << allow << endl;
	}
}

Double click to view unformatted code.


Back to problem 8