Find the largest palindrome made from the product of two 3-digit numbers

前端 未结 17 989
天涯浪人
天涯浪人 2021-02-02 04:27
package testing.project;

public class PalindromeThreeDigits {

    public static void main(String[] args) {
        int value = 0;
        for(int i = 100;i <=999;i+         


        
17条回答
  •  既然无缘
    2021-02-02 05:01

    What about : in python

    >>> for i in range((999*999),(100*100), -1):
    ...     if str(i) == str(i)[::-1]:
    ...         print i
    ...         break
    ...
    997799
    >>>
    

提交回复
热议问题