请C语言高手帮我解决一下这道题?十分感谢

2024-12-28 18:58:08
推荐回答(1个)
回答1:

#include
void main()
{
int num,k1,k2,k3,k4;
for(num=1000;num<=9999;num++)
{
k1=num/1000;
k2=num%1000/100;
k3=num%100/10;
k4=num%10;
if(k1*k3!=0 && 10*k1+k3==5*(10*k2+k4))
printf("%d\n",num);
}
}