一道水题,只要会复制粘贴就好!
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <numeric>
#include <cstdio>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <climits>
#include <vector> #define PI acos(-1)
using namespace std; int Judge_Ten (int i) {
int res = ;
while (i) {
res += i % ;
i /= ;
}
return res;
} int Judge_Hex (int i) {
int res = ;
while (i) {
res += i % ;
i /= ;
}
return res;
} int Judge_Twe (int i) {
int res = ;
while (i) {
res += i % ;
i /= ;
}
return res;
} bool Judge (int i) {
if (Judge_Hex(i) == Judge_Twe(i) && Judge_Ten(i) == Judge_Twe(i)) {
return true;
}
return false;
} int main () {
//cout << Judge_Ten (2992) << endl;
//cout << Judge_Twe (2992) << endl;
//cout << Judge_Hex (2992) << endl;
//freopen ("out.txt", "w", stdout);
for (int i = ; i < ; ++ i) {
if (Judge (i)) {
cout << i << endl;
} else {
continue;
}
}
return ;
}