摘要: 1、 编写一个简单程序,要求数组长度为5,分别赋值10,20,30,40,50,在控制台输出该数组的值。(知识点:数组定义和创建、一维数组初始化)[必做题]? package qwer; public class Qwer { public static void main(String[] arg 阅读全文
posted @ 2021-04-27 12:25 曹新 阅读(65) 评论(0) 推荐(0)
摘要: 1.编写一个简单程序,要求数组长度为5,静态赋值10,20,30,40,50,在控制台输出该数组的值。 public class Onw { public static void main(String[] args){ int i=0; int a[]={10,20,30,40,50}; for( 阅读全文
posted @ 2021-04-19 16:56 曹新 阅读(49) 评论(0) 推荐(0)
摘要: 上机练习: 使用for循环计算1-100的和,除了以3结尾的那些数 public class Sj { public static void main(String[] args){ int i = 1; int sum = 0; for(i=1;i<=100;i++){ if(i!=2||i%10 阅读全文
posted @ 2021-04-13 12:33 曹新 阅读(59) 评论(0) 推荐(0)
摘要: 上机练习 1.分别使用for循环,while循环,do循环求1到100之间所有能被3整除的整数的和。(知识点:循环语句) package rewrwe; public class The_first { public static void main(String[] args){ int i=1; 阅读全文
posted @ 2021-04-06 13:40 曹新 阅读(84) 评论(0) 推荐(0)
摘要: 上机练习 输入一个年份,判断是不是闰年(能被4整除但不能被100整除,或者能被400整除) package xt; import java.util.Scanner; public class the1 { public static void main(String[] args) { Scann 阅读全文
posted @ 2021-03-30 11:04 曹新 阅读(63) 评论(0) 推荐(0)
摘要: 1.输入商品单价,数量,求总价。活动8折后抹零,计算活动价。输入付款金额,计算找零并输出 import java.util.Scanner;public class A {public static void main(String[] args) {//单价为d,数量为n,总价为sum,折后价为z 阅读全文
posted @ 2021-03-30 10:59 曹新 阅读(82) 评论(0) 推荐(0)
摘要: 1.编写一个程序,定义圆的半径,求圆的面积. public class test1 { public static void main(String[] args) { // TODO Auto-generated method stub //a为半径,s为面积 int a=4; double s; 阅读全文
posted @ 2021-03-12 09:43 曹新 阅读(56) 评论(0) 推荐(0)
摘要: 1.输出学号班级和姓名 public class test1 { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("193230101计算机1901曹新"); 阅读全文
posted @ 2021-03-05 14:20 曹新 阅读(62) 评论(0) 推荐(0)