摘要: 1.编写一个简单程序,要求数组长度为5,静态赋值10,20,30,40,50,在控制台输出该数组的值。 package chap6; public class text1 { public static void main(String[] args) { // 1.编写一个简单程序,要求数组长度为 阅读全文
posted @ 2021-04-16 16:02 计算机1901金皓楠 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 上机练习:1.使用for循环计算1-100的和,除了以3结尾的那些数 package chap5; public class text2 { public static void main(String[] args) { // 使用for循环计算1-100的和,除了以3结尾的那些数 int sum 阅读全文
posted @ 2021-04-10 16:02 计算机1901金皓楠 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 1.分别使用for循环,while循环,do循环求1到100之间所有能被3整除的整数的和。(知识点:循环语句) package chap4; public class text1 { public static void main(String[] args) { // TODO Auto-gene 阅读全文
posted @ 2021-04-02 16:09 计算机1901金皓楠 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 1.输入一个年份,判断是不是闰年(能被4整除但不能被100整除,或者能被400整除) package chap3; import java.util.Scanner; public class text1 { public static void main(String[] args) { // T 阅读全文
posted @ 2021-03-26 19:26 计算机1901金皓楠 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 1.编写一个程序,定义圆的半径,求圆的面积. package chap1; public class text6 { public static void main(String[] args) { double r=2; double s; s=3.14*r*r; System.out.print 阅读全文
posted @ 2021-03-12 09:43 计算机1901金皓楠 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 1.输出学号班级和姓名 package chap1; public class text1 { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("193230 阅读全文
posted @ 2021-03-05 10:30 计算机1901金皓楠 阅读(52) 评论(0) 推荐(0) 编辑