Cod sursa(job #3220131)
Utilizator | Data | 2 aprilie 2024 16:12:46 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | c-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *z, *y;
int a,b,c=0,d,v[20]={1,4,7,6,5,6,3,6,9,0,1,6,3,6,5,6,3,4,9,0},e=0,f;
z=fopen("cifra.in","r");
y=fopen("cifra.out","w");
fscanf(z,"%d",&a);
while(c<a){
fscanf(z,"%d",&b);
d=b%20;
e=0;
f=0;
while(e<d){
f=f+v[e];
e++;
}
fprintf(y,"%d\n", f%10);
c++;
}
return 0;
}