Sample Input
Sample Output
2
4
6
8
主要是化输入的十进制数为五进制就行了
#include<stdio.h>
int a[5]={0,2,4,6,8};
void main()
{
int m,n,i,b[50];
scanf("%d",&n);
while(n--)
{
i=0;
scanf("%d",&m);
if(m<=4)printf("%d
",a[m]);
else
{
while(m)b[i++]=m%5,m/=5;
if(m)b[i++]=m;
i--;
while(i>=0)printf("%d",a[b[i--]]);
printf("
");
}
}
}