摘要:
1.使用for循环计算1-100的和,除了以3结尾的那些数. public class Test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub in 阅读全文
摘要:
1.分别使用for循环,while循环,do循环求1到100之间所有能被3整除的整数的和。 for循环 public class Text { /** * @param args */ public static void main(String[] args) { // TODO Auto-gen 阅读全文
摘要:
1.输入一个年份,判断是不是闰年(能被4整除但不能被100整除,或者能被400整除) import java.util.Scanner; public class Test { /** * @param args */ public static void main(String[] args) { 阅读全文
摘要:
public class Test2 { /** * @param args */ public static void main(String[] args) { int r=5; double s=3.14*r*r; System.out.println("圆的面积为S="+s); } } pu 阅读全文