Cod sursa(job #458684)

Utilizator MythGhiorghe Mihaita Myth Data 25 mai 2010 19:53:45
Problema Cifra Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.27 kb
#include <fstream>
#include <vector>

using namespace std;

unsigned int n,v[10]={1,5,2,8,3,9,2,8,7,7};
int t;

int main() {
	ifstream f("cifra.in");
	ofstream g("cifra.out");
	f>>t;
	for (;t--;) {
		f>>n; n--;
		g<<(7*(n/10)+v[n%10])%10<<endl;
	}
	return 0;
}