查看: 877|回复: 3
|
java问题。。。
[复制链接]
|
|
谁可以教我怎么做?
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”
我是新手。。。 |
|
|
|
|
|
|
|
发表于 17-5-2007 10:50 PM
|
显示全部楼层
做法:
1。和 SotongJiang 说的一样用 % 来除,如果可以被除的话结果将是 0。
2。同上。 |
|
|
|
|
|
|
|
发表于 18-5-2007 06:22 PM
|
显示全部楼层
|
|
|
|
|
|
|
发表于 18-5-2007 11:54 PM
|
显示全部楼层
|
|
|
|
|
|
| |
本周最热论坛帖子
|