Cod sursa(job #139232)
| Utilizator | Data | 19 februarie 2008 20:51:32 | |
|---|---|---|---|
| Problema | Cifra | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include<fstream.h>
#include<iostream.h>
int main()
{int n,x;
ifstream in("cifra.in");
ofstream out("cifra.out");
in>>n;
for(int i=1;i<=n;++i)
{in>>x;
if(x%10==1) out<<"1"<<endl;
else
if(x%10==2) out<<"5"<<endl;
else
if(x%10==3) out<<"4"<<endl;
else
if(x%10==4) out<<"0"<<endl;
else
if(x%10==5) out<<"5"<<endl;
else
if(x%10==6) out<<"1"<<endl;
else
if(x%10==7) out<<"0"<<endl;
else
if(x%10==8) out<<"5"<<endl;
else
if(x%10==9 || x%10==0) out<<"1"<<endl;}
return 0;
}