#include <iostream>
using namespace std;
int calc(int k, int b)
{
int result=0;
while(k/b)
{
result+=(k%b);
k/=b;
}
result+=(k%b);
return result;
}
int main()
{
int i;
for(i=2992;i<=9999;i++)
if((calc(i,10)==calc(i,16)) && (calc(i,10)==calc(i,12)) && (calc(i,16)==calc(i,12)))
cout<<i<<endl;
return 0;
}
poj_2196
最新推荐文章于 2021-01-19 17:15:40 发布