摘要: package rrrr; public interface Fruit { class apple implements Fruit { public apple() { System.out.println("创建了一个苹果类对象"); } } class grape implements Fr 阅读全文
posted @ 2023-06-20 21:42 ᯤ⁶ºᴳ⁺ 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 1、给定一个有9个整数(1,6,2,3,9,4,5,7,8)的数组,先排序,然后输出排序后的数组的值。 package 学校作业; import java.util.Arrays; public class test { public static void main(String[] args) 阅读全文
posted @ 2023-05-08 21:30 ᯤ⁶ºᴳ⁺ 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 1.编写一个简单程序,要求数组长度为5,静态赋值10,20,30,40,50,在控制台输出该数组的值 package test; public class test_1 { public static void main(String[] args) { // TODO Auto-generated 阅读全文
posted @ 2023-04-17 21:24 ᯤ⁶ºᴳ⁺ 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 1.使用for循环计算1-100的和,除了以3结尾的那些数 package 第六周; public class test { public static void main(String[] args) { // TODO Auto-generated method stub int sum=0; 阅读全文
posted @ 2023-04-11 23:12 ᯤ⁶ºᴳ⁺ 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 1、分别使用for循环,while循环,do循环求1到100之间所有能被3整除的整数的和。(知识点:循环语句) package 第五周作业; public class test { public static void main(String[] args) { // TODO Auto-gener 阅读全文
posted @ 2023-04-02 22:10 ᯤ⁶ºᴳ⁺ 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 1、输入年份月份,输出该月的天数(闰年2月29天,条件参考上机练习1) package 第四周上机; import java.util.Scanner; public class test1 { public static void main(String[] args) { // TODO Aut 阅读全文
posted @ 2023-03-24 23:40 ᯤ⁶ºᴳ⁺ 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 1 定义圆形半径,求面积。 package 测试; import java.util.Scanner; public class test { public static void main(String[] args) { // TODO Auto-generated method stub Do 阅读全文
posted @ 2023-03-19 22:02 ᯤ⁶ºᴳ⁺ 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 1.编写程序,统计字符串中大写字母的个数 #include<stdio.h> main() { char str[20]; int i,cnt; cnt= i=0; gets(str); while(str[i]!='\0') { if(str[i]>='A'&&str[i]<='Z') cnt++ 阅读全文
posted @ 2021-11-24 21:33 ᯤ⁶ºᴳ⁺ 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 1.定义一个含有8个储存单元的实型数组,从键盘山接收数,然后逆序输出 #include<stdio.h> main() { double m[8]; int i; for(i=0;i<=7;i++) scanf("%lf",&m[i]); for(i=7;i>=0;i--) printf("%f", 阅读全文
posted @ 2021-11-16 10:06 ᯤ⁶ºᴳ⁺ 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 1. * ** *** **** ***** #include<stdio.h> main() { int i,j; for(i=1;i<=5;i++){ for(j=1;j<=i;j++){ printf("*"); } printf("\n"); } ******* ***** *** * #i 阅读全文
posted @ 2021-11-12 15:03 ᯤ⁶ºᴳ⁺ 阅读(14) 评论(0) 推荐(0) 编辑