Closed. This question needs details or clarity。它当前不接受答案。
                            
                        
                    
                
            
                    
                
                        
                            
                        
                    
                        
                            想改善这个问题吗?添加详细信息并通过editing this post阐明问题。
                        
                        2年前关闭。
                    
                
        

package com.wukang.demo;

public class Demo {

    public static void main(String[] args) {
        for (int i = 11; i < 32;i++) {
            int a = i * i;
            int b = i & 10;
            int c = i / 10;
            if((a / 10 & 10) == c && (a & 10 ) == b ) {
                System.out.println(a);
            }
        }
    }
}

最佳答案

for (int i = 11; i < 32; i++) {
    int a = i * i;
    int b = i % 10;
    int c = i / 10;
    if ((a / 10 % 10) == c && (a % 10) == b) {
    //---------------------------^
        System.out.println(a);
    }
}


您使用&而不是%

关于java - 为什么我的程序没有结果?a肯定是625 ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/43761779/

10-11 06:08