佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 877|回复: 3

java问题。。。

[复制链接]
发表于 17-5-2007 11:06 AM | 显示全部楼层 |阅读模式
谁可以教我怎么做?
1.         Write a program (name it as P1.java)  to :
- accept an integer number from the user
- check whether the number is divisible by 3
- display “The number is divisible by 3” if it is
              otherwise display “The number is NOT divisible by 3”

2.         Write a program (name it as P2.java)  to :
- accept an integer number from the user
- check whether the number is divisible by both 3 and 5
- display “The number is divisible by both 3 and 5” if it is
              otherwise display “The number is NOT divisible by both 3 and 5”

我是新手。。。
回复

使用道具 举报


ADVERTISEMENT

发表于 17-5-2007 10:50 PM | 显示全部楼层
做法:

1。和 SotongJiang 说的一样用 % 来除,如果可以被除的话结果将是 0。
2。同上。
回复

使用道具 举报

发表于 18-5-2007 06:22 PM | 显示全部楼层
你只要会用 system.out.println, if... else, && operator. 你就知道怎么做。。。
回复

使用道具 举报

发表于 18-5-2007 11:54 PM | 显示全部楼层
你只要会用 system.out.println, if... else, && operator. 你就知道怎么做。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 4-9-2025 06:02 PM , Processed in 0.323748 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表