fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int findPalindrom3x3() {
  6. for (int i=9; i>=0; --i)
  7. for (int j=9; j>=0; --j)
  8. for (int k=9; k>=0; --k) {
  9. int liczba = i*100001+j*10010+k*1100;
  10. for (int p = 999; p>=100; p--) {
  11. if (liczba/p<100)
  12. continue;
  13. if (liczba/p>999)
  14. break;
  15. if (liczba%p==0)
  16. return liczba;
  17. }
  18. }
  19. return 0;
  20. }
  21.  
  22. int main() {
  23. cout << findPalindrom3x3() << endl;
  24. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
906609