hc学习平台

 找回密码
 立即注册
搜索
热搜: 活动 交友 javakc
 › 1360393788 › 日志

判断一个数能否同时被 3 和 5 整除。   

2022-08-05 16:51:19 查看(51) 回复(0)

 

package test_8_5;

import java.util.Scanner;

public class test_03 {
    public static void main(String[] args) {
        int a;
        int b;
        Scanner sc=new Scanner(System.in);
        int c=sc.nextInt();
        a=c%3;
        b=c%5;
        if (a==0&&c==0){
            System.out.println("可以被整除");
        }else {
            System.out.println("不可以被整除");
        }
        
    }
}

评论 (0 个评论)

facelist

全部作者的其他最新日志



站点统计|举报|Archiver|手机版|小黑屋|Comsenz Inc.

GMT+8, , Processed in 0.195171 second(s), 9 queries .

Powered by javakc! X1.0

© 2004-2014 javakc

f1208.com 备案号:京ICP备14030918号-1

返回顶部