View Code of Problem 8

#include<iostream>
#include<cmath>
#include<cstdio>
#include <string>
#include <stdio.h>
#include <string.h>
using namespace std;
int main() {
	int n;
	char data[100];
	cin >> n;
	int a[11] = { 287,294,286,293,293,293,293,293,294,294 };
	for (int i = 0; i < n; i++) {
		scanf("%s", data);
		int m = strlen(data);
		printf("%d", a[data[m - 1] - '0']);
	}
	
	return 0;
}	

Double click to view unformatted code.


Back to problem 8