View Code of Problem 8

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	int ans[10]={ 287,294,286,293,293,293,293,293,294,294 };
	cin>>n;
	while(n--){
		string a;
		cin>>a;
		int ss=a[a.size()-1]-'0';
		cout<<ans[ss]<<endl;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 8