摘要:
1. 分别使用for循环,while循环,do循环求1到100之间所有能被3整除的整数的和。(知识点:循环语句) for循环: public class fourth { public static void main(String[] args) { int sum=0; for(int i=1; 阅读全文
摘要:
1.输入变量x的值,如果是1,输出x=1,如果是5,输出x=5,如果是 10,输出 x=10,除了以上几个值,都输出x=none。(知识点:if条件语句) import java.util.Scanner; public class work { public static void main(St 阅读全文
摘要:
1.输入一个年份,判断是不是闰年(能被4整除但不能被100整除,或者能被400整除) import java.util.Scanner; public class thirdwork { public static void main(String[] args) { Scanner input=n 阅读全文
摘要:
1、已知a,b均是整型变量,写出将a,b两个变量中 的值互换的程序。(知识点:变量和运算符综合 应用) public class work { public static void main(String[] args) { int a=5; int b=8; int c=a; a=b; b=c; 阅读全文