/*
 * 求100之内能被3整除不能被5整除的所有整数,和个数
 */
public class Test02 {
    
    private int count = 0;

    public static void main(String[] args) {
        new Test02().Init();
    }
    
    public void Init(){
        for(int i=0;i<=100;i++){
            if(i%3==0&&i%5!=0){
                System.out.println(i);
                count++;
            }
        }
        System.out.println("共"+count);
    }
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案