摘要: 1 #include<stdio.h> 2 int main(){ 3 int a;scanf("%1d",&a); 4 if(a==0)return 0; 5 int grade;scanf("%3d",&grade); 6 int academy[5];for(int i=1;i<=4;i++) 阅读全文
posted @ 2022-05-06 22:05 HzzzzLi 阅读(619) 评论(0) 推荐(0)
摘要: class Dog{ //利用封装的方法,定义 size 变量,使得 size 变量的值始终大于 10 /*编写 bark方法,size值 > 60的时候输出“Woof!”;size值 > 40的时候输出“Ruff!”; 其他取值时输出“Yip!”。*/ } public class DogTest 阅读全文
posted @ 2022-04-30 23:25 HzzzzLi 阅读(170) 评论(0) 推荐(0)
摘要: import java.util.*; public class Main{ public static void main(String[] args) { Circle circle=new Circle(); Scanner scanner=new Scanner(System.in); ci 阅读全文
posted @ 2022-04-30 23:09 HzzzzLi 阅读(205) 评论(0) 推荐(0)
摘要: class Outer { static int a=10; int b=20; int c=40; void fun(){ Inner e=new Inner(); e.g(); } class Inner{ int c=30; int b=50; Outer f=new Outer(); sta 阅读全文
posted @ 2022-04-26 21:17 HzzzzLi 阅读(21) 评论(0) 推荐(0)
摘要: import java.util.*; public class Test01 { public static void main(String[] args) { Scanner read=new Scanner(System.in); int a[]; a=new int[10]; for(in 阅读全文
posted @ 2022-04-06 15:07 HzzzzLi 阅读(102) 评论(0) 推荐(0)
摘要: import java.util.Scanner; public class Test01 { public static void main(String[] args) { //用循环语句计算 1 + 1/2!+ 1/3!+ 1/4!…的前 20 项之和。(提示:结果要求误差小于 //0.000 阅读全文
posted @ 2022-04-06 14:54 HzzzzLi 阅读(228) 评论(0) 推荐(0)
摘要: import java.util.Scanner; public class Test01 { public static void main(String[] args) { int t = 0; boolean f = true; //用两层循环语句求出素数 //第一层循环为遍历 2~100(变 阅读全文
posted @ 2022-04-06 14:48 HzzzzLi 阅读(1581) 评论(0) 推荐(0)
摘要: 设计程序要求输入一个日期后,可以显示下一天日期。 import java.util.Scanner; public class Test01 { public static void main(String[] args) { int y, m, d; //年、月、日 int dnum = 0; / 阅读全文
posted @ 2022-04-06 14:30 HzzzzLi 阅读(40) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { printf("%d",256*256*256*4); return 0; } 解析 byte就是字节 3.1byte=8bit 4.1byte就是1B 阅读全文
posted @ 2022-04-05 00:23 HzzzzLi 阅读(65) 评论(0) 推荐(0)
摘要: ​ 编程题:用类描述计算机中CPU的速度和硬盘的容量。要求Java应用程序有4个类,名字分别是PC、CPU、HardDisk和Test,其中Test是主类。 · PC类与CPU和HardDisk类关联的UML图(见图4.34) 其中,CPU类要求getSpeed()返回speed的值,要求setSp 阅读全文
posted @ 2022-04-05 00:21 HzzzzLi 阅读(426) 评论(0) 推荐(0)