04 2022 档案
摘要:class Dog{ //利用封装的方法,定义 size 变量,使得 size 变量的值始终大于 10 /*编写 bark方法,size值 > 60的时候输出“Woof!”;size值 > 40的时候输出“Ruff!”; 其他取值时输出“Yip!”。*/ } public class DogTest
阅读全文
摘要:import java.util.*; public class Main{ public static void main(String[] args) { Circle circle=new Circle(); Scanner scanner=new Scanner(System.in); ci
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:import java.util.Scanner; public class Test01 { public static void main(String[] args) { //用循环语句计算 1 + 1/2!+ 1/3!+ 1/4!…的前 20 项之和。(提示:结果要求误差小于 //0.000
阅读全文
摘要:import java.util.Scanner; public class Test01 { public static void main(String[] args) { int t = 0; boolean f = true; //用两层循环语句求出素数 //第一层循环为遍历 2~100(变
阅读全文
摘要:设计程序要求输入一个日期后,可以显示下一天日期。 import java.util.Scanner; public class Test01 { public static void main(String[] args) { int y, m, d; //年、月、日 int dnum = 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
阅读全文
摘要: 编程题:用类描述计算机中CPU的速度和硬盘的容量。要求Java应用程序有4个类,名字分别是PC、CPU、HardDisk和Test,其中Test是主类。 · PC类与CPU和HardDisk类关联的UML图(见图4.34) 其中,CPU类要求getSpeed()返回speed的值,要求setSp
阅读全文
摘要: 目录: 指针与数组 指针与字符串 函数指针 指针函数 指针数组 多重指针 动态内存分配与指针 1.指针与数组: (2)用字符型指针变量作实参 (3)用字符指针变量作形参和实参 3.函数指针: 1. 2.
阅读全文
摘要:核心:队列 1 #include<stdio.h> 2 struct note 3 { 4 int x; 5 int y; 6 int s; 7 8 }; 9 int main(){ 10 struct note que[2501]; 11 int a[51][51]={0},book[51][51
阅读全文
摘要: Pattern与Matcher 这两个类都在java.util.regex包中 总结: (获取pattern对象) 2.p.pattern();返回其对应的正则表达式的字符串形式 3. Pattern有一个split(CharSequence input)方法,用于分隔字符串,其中Patte
阅读全文
摘要:import java.util.Scanner; class Point{ double x; double y; } public class Test01 { public static void main(String[] args){ Point a=new Point(); Point
阅读全文