906609
real 0m0.191s
user 0m0.180s
sys 0m0.000s
/*************************************************************************
> File Name: 004.cpp
> Author: ma6174
> Mail: ma6174@163.com
> Created Time: Tue 31 Dec 2019 11:07:35 CST
************************************************************************/
#include<iostream>
using namespace std;
int is_val(int n) {
int tmp = n;
int sum = 0;
while (n) {
int d = n % 10;
sum = sum * 10 + d;
n /= 10;
}
return sum == tmp;
}
int main() {
int max = 0;
for (int i = 100; i <= 999; i++) {
for (int j = 100; j <= 999; j++) {
int sum = i * j;
if(is_val(sum) && sum > max) max = sum;
}
}
cout << max << endl;
return 0;
}