Pagini recente » Cod sursa (job #295412) | Cod sursa (job #1491824) | Cod sursa (job #2377158) | Cod sursa (job #1402584) | Cod sursa (job #139230)
Cod sursa(job #139230)
#include<fstream.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;
}