| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 147286 | 胡海峰老师 | 能否被3和5整除 | Java | Wrong Answer | 0 MS | 316 KB | 563 | 2026-02-03 19:36:02 |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); int number = input.nextInt(); // 处理所有整数(正数、负数、零) boolean divisibleBy3 = (number % 3 == 0); boolean divisibleBy5 = (number % 5 == 0); if (divisibleBy3 && divisibleBy5) { System.out.println("can"); } else { System.out.println("cannot"); } input.close(); } }
------Input------
90
------Answer-----
can
------Your output-----