基础编程每日练习题汇总

1.while 的语句使用

import java.util.Scanner;

//while 的语句使用
public class Test02 {
	public static void main(String[] args) {
		//String answer;// 标志是否合格
		Scanner input = new Scanner(System.in);
		System.out.print("合格了吗?(y/n)");
		String answer = input.next();
		while("n".equals(answer)){
		//或者while (!"y".equals(answer)) {
			System.out.println("上午阅读教材");
			// 每次执行完学习任务,需要验证下是否合格 保证有机会跳出循环
			System.out.println("合格了吗?(y/n)");
			answer = input.next();
		}
		System.out.println("完成学习任务!");
	}

}

2.braek 的使用

import java.util.Scanner;

//braek 的使用     break和循环条件一起使用  使的循环跳出,
//计算学院 的平均分循环录入学院的成绩,输入负值是退出
//boolean 执行外面@[TOC](这里写自定义目录标题)
public class imptSorce {
//布尔的使用
	public static void main(String[] args) {
         System.out.println("请输入姓名:");
		Scanner input = new Scanner(System.in);
		String name = input.next();
		int sum = 0;
		boolean flag = true;
		for (int i = 1; i <= 5; i++) {
			System.out.println("请输入第" + i + "门课的成绩:");
			int score = input.nextInt();
			// 输入为负,跳出循环
			if (score < 0) {
				flag = false;
				break;
			}
			sum += score;
		}
		if (flag == true) {
			double avg = sum / 5;
			System.out.println(name + "的五门成绩单平均分为" + avg);
		} else {
			System.out.println("抱歉,分数录入有误,请重新录入!");
		}
	}

}

3.continue 的使用

import java.util.Scanner;

//continue 的使用 
public class Test07 {
//需要重看视频
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		System.out.println("请输入班级人数:");
		int total = input.nextInt();// 记得多默写几遍 老是打错。
		int score = 0;
		int num = 0;
			int i = 0;// 统计正数的个数
			int j = 0
		for (int i = 1; i <= total; i++) {
			System.out.println("请录入第" + i + "个同学的java成绩:");
			score = input.nextInt();
			if (score < 80) {
				continue;
			}
			num++;
		}
		System.out.println("80分以上的学生人数为:" + num);
		double bili = (double) num / total * 100;
		System.out.println("80分以上的学生人数所占的比例为:" + bili + "%");
	}

}
import java.util.*;
//声明
public class Test4 {
	public static void main (String[] args) {
		Scanner input = new Scanner(System.in); 			
				System.out.print("STB的成绩是:");
		int STB =input.nextInt();
		System.out.print("JAVA的成绩是:");
		int JAVA = input.nextInt();
		System.out.print("SQL的成绩是:");
		int SQL =input.nextInt();
		System.out.println("----------------------------------");
		System.out.println("STB\tJAVA\tSQL");
	 	System.out.println(STB +"\t"+ JAVA +"\t"+ SQL);
	 	System.out.println("----------------------------------");
	 	int cha =(JAVA-SQL);
	 	System.out.println("JAVA和SQL的成绩之差:" + cha);
	 	int avg = (STB+JAVA+SQL)/3;
	 	System.out.println("平均成绩"+avg);
	}
}

5.九九乘法表

//99乘法表 双重循环
public class Text05 {
	public static void main(String[] args) {
		// 乘数a 外 被乘数为b 内
		for (int a = 1; a <= 9; a++) {
			for (int b = 1; b <= a; b++) {
				System.out.print(a + "*" + b + "=" + (a * b) + "\t");
			}
			System.out.println();//打断 这个打断很重要
		}
	}
}

//练习1
public class text1 {
	public static void main (String[]args) {
//	    System.out.println ("Hello word!");
//		System.out.println((char)85);
		int num1 = 5;
		int num2 = 2;
		int a = num1 % num2;
		int b = num1 / num2;
		System.out.println(num1+"%"+num2+"="+b);
		System.out.println(num1+"/"+num2+"="+a);
		//+ 连接
		num1++;
		num2--;
		System.out.println("num1="+num1);
		System.out.println("num2="+num2);
		
	}
}
//练习2
public class Text2 {
	public static void main(String[] args) {
		int x=8;
		int y=9;
		System.out.print((++x==y)||(++x!=y));
		System.out.println(x);

	}
}
输出值:true   9

import java.util.Scanner;
//练习3   判断一个数值是否为偶数
public class Test3 {
	public static void main(String[] args) {
		Scanner input = new Scanner (System.in);
		System.out.println("请输入一个非零的数字:");
		int num = input.nextInt();
//条件运算符的运用		
		String result = (num%2==0) ? "偶数":"奇数";
		//if(num%2==0) 如果余数结果为0,则是偶数;如果余数记过不等于0则为奇数
			System.out.println(num+"是"+result);
	}
}

import java.util.Scanner;

public class Test05 {
//输入4位数的  解析个十百千万的方法
	public static void main(String[] args) {
		System.out.print("请输入4位会员号:");
		Scanner input = new Scanner(System.in);
		int custNo = input.nextInt();
		int gewei = custNo % 10;
		System.out.println("个位数字:" + gewei);
		int shiwei = custNo / 10 % 10;
		System.out.println("十位数字" + shiwei);
		int baiwei = custNo / 100 % 10;
		System.out.println("百位数字:" + baiwei);
		int qianwei = custNo / 1000;
		System.out.println("千位数字:" + qianwei);
		System.out.println();
		int sum = gewei + shiwei + baiwei + qianwei;
		System.out.println("各数字之和" + sum);
		System.out.print("是幸运客户?");
		  if (sum>=20){ 
			  System.out.println("true"); 
			  } else { 
		  System.out.println("false"); 
	  }
	}

}

package day0316;
//左右手换牌   temp是关键
public class Test01 {
	public static void main(String[] args) {
		int a = 10;
		int b = 8;

		System.out.println("输出前互换前手中的纸牌");
		System.out.println("左手中的纸牌:" + a);
		System.out.println("右手中的纸牌:" + b);
		System.out.println();
		int temp;
		temp = a;
		a = b;
		b = temp;
		System.out.println("输出后互换前手中的纸牌");
		System.out.println("左手中的纸牌:" + a);
		System.out.println("右手中的纸牌:" + b);

	}

}

while 跳转的使用

import java.util.Scanner;
//while 跳转的使用
public class Test05 {
	public static void main(String[] args) {
		System.out.print("请输入本次的考试成绩:");
		Scanner input = new Scanner(System.in);
		while (true) {
			int grade = input.nextInt();
			if (grade < 100 && grade >= 90) {
				System.out.println("奖励一部车");
				// if else 区间的知识点还是有点欠缺,最后一个的IF直接取消
			} else if (grade <= 90 && grade >= 80) {
				System.out.println("妈妈给他MP4!");
			} else if (grade <= 80 && grade >= 60) {
				System.out.println("妈妈给他买本参考书!");
			} else {
				System.out.println("什么都没有!");
				// while跳回重新输入的运用程度还不是很熟练;
			}
		}

	}

}

if嵌套

package day0316;

//if嵌套
import java.util.Scanner;

public class Test06 {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		System.out.println("请输入是否是会员:是(y)/否(其他字符):");
		String answer = input.next();
		if ("y".equals(answer)) {
			System.out.println("请输入购物金额:");
			double price = input.nextDouble();
			if (price >= 200) {
				System.out.println("实际支付:" + price * 0.75);
			} else {
				System.out.println("实际支付:" + price * 0.8);
			}
		} else {
			System.out.println("请输入购物金额:");
			double price = input.nextDouble();
			if (price >= 100) {
				System.out.println("实际支付:" + price * 0.9);
			} else {
				System.out.println("实际支付" + price);
			}
		}
	}
}

switch的使用

package day0317;
import java.util.Scanner;
//switch的使用
public class Test05 {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		System.out.print("输入数字:");
		int num = input.nextInt();
		// int num = 1;
		switch (num) {
		case 1:
			System.out.println("将参加麻省理工大学组织的一个月夏令营");
			break;
		case 2:
			System.out.println("将奖励惠普电脑笔记本一台");
			break;
		case 3:
			System.out.println("奖励移动硬盘一个");
			break;
		case 4:
			System.out.println("不给任何奖励");
			break;
		}
	}

}

default的用法

package day0317;

import java.util.Scanner;
//default的用法  可置前  可置后
public class Test06 {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		System.out.print("输入星期几:");
		int day = input.nextInt();
		switch (day) {
		case 1:
		case 3:
		case 5:
			System.out.println("学习编程");
			break;
		case 2:
		case 4:
			System.out.println("学习英语");
		case 6:
		case 7:
			System.out.println("休息");
		default:
			System.out.println("请重新输入!");
			break;
		}

	}

}

打印10以内的偶数之和

package day0318;

//打印10以内的偶数之和
public class Test05 {
	public static void main(String[] args) {
		int sum = 0;
		for (int i = 1; i <= 10; i++) {
			if (i % 2 == 0) {
				sum = sum + i;
			}

		}
		System.out.println("10之内的偶数之和"+sum);
	}
}

嵌套if选择功结构,switch 选择结构,多重if 选择结构实现商品换购功能

package day0319;
import java.util.Scanner;
//嵌套if选择功结构,switch 选择结构,多重if 选择结构实现商品换购功能
public class Test05 {

	public static void main(String[] args) {
		while (true) {
			System.out.println();
			System.out.print("请输入消费金额:");
			Scanner input = new Scanner(System.in);
			int price = input.nextInt();
			if (price < 50) {
				System.out.println("不具备参赛资格");
				break;//直接中断小于50的消费金额    有点Bug
			} else {
				System.out.println("1:满50元,加2元换购百事可乐饮料一瓶");
				System.out.println("2:满100元,加3元换购500ml饮料一瓶");
				System.out.println("3:满100元,加10元换购百事可乐饮料一瓶");
				System.out.println("4:满200元,加20元换购百事可乐饮料一瓶");
				System.out.println("5:满200元,加20元换购百事可乐饮料一瓶");
				System.out.println("0:不换购");
				// System.out.print("是否参加优惠换购活动(y/n):");
			}
			System.out.print("请选择:");
			int num = input.nextInt();
			switch (num) {
			case 1:
				if (price >= 50) {
					System.out.println("本次消费总金额:" + (double) (price + 2));
					System.out.println("成功换购:百事可乐1瓶。");
				} else {

					System.out.println("不满足消费金额条件,请重新输入");
				}
				break;
			case 2:
				if (price >= 100) {
					System.out.println("本次消费总金额:" + (double) (price + 3));
					System.out.println("成功换购:500ml饮料一瓶。");
				} else {

					System.out.println("不满足消费金额条件,请重新输入");
				}
				break;
			case 3:
				if (price >= 100) {
					System.out.println("本次消费总金额:" + (double) (price + 10));
					System.out.println("成功换购:5斤面粉。");
				} else {

					System.out.println("不满足消费金额条件,请重新输入");
				}
				break;
			case 4:
				if (price >= 200) {
					System.out.println("本次消费总金额:" + (double) (price + 10));
					System.out.println("成功换购:苏泊尔炒菜锅。");
				} else {

					System.out.println("不满足消费金额条件,请重新输入");
				}
				break;
			case 5:
				if (price >= 200) {
					System.out.println("本次消费总金额:" + (double) (price + 20));
					System.out.println("成功换购:欧莱雅爽肤水。");
				} else {

					System.out.println("不满足消费金额条件,请重新输入");
				}
				break;
			case 0:
				System.out.println("不换购");
			default:
				System.out.println("请重新输入!");
				break;
			}
		}
	}

}

保留小数

DecimalFormat df = new DecimalFormat("0.00");//保留小数点后面两位数
		String s = df.format(1 - 0.8);
		double result = Double.valueOf(s);
		System.out.println(result);
int random=(int)(Math.random()*1000);//产生随机数的100~999的方法     *号之后的数字可变的   
		 System.out.println(random);
package day0319;
//一个".java"源文件中是否可以包括多个类(不是内部类)?有什么限制?  答:可以。但最多只有一个类名声明为public,与文件名相同。

public class Test03 {
	public static void main(String[] args) {
		System.out.println(123);
	}
}

class Test033 {
	public static void main(String[] args) {
		System.out.println(456);
	}
}

class Test034 {
	public static void main(String[] args) {
		System.out.println(789);
	}
}
package day0316;
//成绩录入之后的优化的结果
import java.util.Scanner;

public class Test05 {
	public static void main(String[] args) {
		System.out.print("请输入本次的考试成绩:");
		Scanner input = new Scanner(System.in);
		while (true) {
			int grade = input.nextInt();
			if (grade <= 100 && grade >= 90) {
				System.out.println("奖励一部车");
				// if else 区间的知识点还是有点欠缺,最后一个的IF直接取消
			} else if (grade < 90 && grade >= 80) {
				System.out.println("妈妈给他MP4!");
			} else if (grade < 80 && grade >= 60) {
				System.out.println("妈妈给他买本参考书!");
			} else if(grade >=0 && grade <60){
				System.out.println("什么都没有!");
				// while跳回重新输入的运用程度还不是很熟练;
			}else {//单独处理边界之外的情况
				System.out.println("数据错误");
			}
		}

	}

}

class Test08 {
	public static void main(String[] args) {
		int h = 80;
		double s = (h - 32) / 1.8;
		System.out.println(h + "华氏度,是摄氏度" + Math.round(s));//四舍五入
	}
}

二维数组的使用

package day0325;
//二维数组的使用
public class Test10 {
	public static void main(String[] args) {
		int[] arr = new int[]{8,2,1,0,3}; 
		int[] index = new int[]{2,0,3,2,4,0,1,3,2,3,3}; 
		String tel = ""; 
		for(int i = 0;i < index.length;i++){ 
		tel = tel+arr[index[i]]; // tel 是字符串和数字在一起连接作用
		//System.out.println("联系方式:" + tel);
		} 
		System.out.println("联系方式:" + tel);

	}

}

吃货联盟订餐系统

package day0321;

import java.util.Scanner;

//吃货联盟订餐系统   
public class Test05 {

	public static void main(String[] args) {
		// 定义数据的主体:菜品
		String[] dishNames = { "红烧带鱼", "鱼香肉丝", "时令蔬菜" };
		double[] prices = { 38.0, 20.0, 10.0 };// 单价
		int[] praiseNums = new int[3];// 点赞数

		String[] names = new String[4];
		String[] dishMsg = new String[4]; // 菜品名称+ 订份数
		int[] times = new int[4];
		String[] adresses = new String[4];
		double[] sumPrices = new double[4];
		int[] states = new int[4];// 0 已预定 1:已完成

		// 初始化2个订单信息
		names[0] = "张三";
		dishMsg[0] = "红烧带鱼 2份";
		times[0] = 10;
		adresses[0] = "知春路223号";
		sumPrices[0] = 76;// 餐费>50 免配送费, 不然,配送费6元;
		states[0] = 0;

		names[1] = "李四";
		dishMsg[1] = "鱼香肉丝1份";
		times[1] = 13;
		adresses[1] = "天成路207号";
		sumPrices[1] = 26;
		states[1] = 1;

		// 搭建项目整体流程框架
		Scanner input = new Scanner(System.in);
		int num = -1;// 用户输入0时返回时的输入数字,num=0时重复显示主菜单;num在用户每次订餐操作后进行提示重新赋值 //有点难理解
		System.out.println("欢迎使用“吃货联盟订餐系统”");
		// 纪录用户是否退出系统的状态:退出 true 不退出flase //没太懂 需多看几遍 boolean 是什么意思 什么作用
		boolean flag = false;
		do {
			System.out.println("******************");
			System.out.println("1,我要订单");
			System.out.println("2,查看餐袋");
			System.out.println("3,签收订单");
			System.out.println("4,删除订单");
			System.out.println("5,我要点赞");
			System.out.println("6,退出系统");
			System.out.println("******************");
			System.out.print("请选择:");
			int choose = input.nextInt();
			switch (choose) {
			case 1:
				System.out.println("\n*******我要订餐********");

				boolean isAdd = false;
				for (int i = 0; i < names.length; i++) {
					if (names[i] == null) { // 订单未满,可以订餐
						isAdd = true;
						System.out.print("请输入订餐人的姓名:");
						String name = input.next();
						// 循环输出菜品的信息
						System.out.println("序号\t菜名\t单价");
						for (int j = 0; j < dishNames.length; j++) {
							String praise = (praiseNums[j] == 0) ? "" : praiseNums[j] + "赞";
							System.out.println((j + 1) + "\t" + dishNames[j] + "\t" + prices[j] + praise);
						}
						// 菜品编号的输入及判断
						System.out.print("请输入你要点的菜品编号:");
						int no = input.nextInt();
						while (no < 1 || no > dishNames.length) {
							System.out.println("本店没有这个菜名,请重新选择:");
							no = input.nextInt();
						}
						// 点菜的份数
						System.out.print("请你输入你需要的份数:");
						int number = input.nextInt();
						// 送餐时间的输入及判断
						System.out.print("请输入你的送餐时间:(送餐时间只能在10-20之间的整点)");
						int time = input.nextInt();
						while (time < 10 || time > 20) {
							System.out.println("你的输入有误,.请重新输入(10-20之间的整数):");
							time = input.nextInt();
						}
						// 送餐地址
						System.out.print("请你输入你的送餐地址:");
						String address = input.next();
						// 输出订餐信息给用户看,
						System.out.println("订餐成功!");
						String dishInfo = dishNames[no - 1] + "" + number + "份";// 用户选择的菜品下标比实际+1
						System.out.println("你订的是:" + dishInfo);
						System.out.println("送餐时间:" + time + "点");
						// 餐费 配送费 总计
						// 餐费 price 数组下标 比用户选择的菜品编号小1
						double dishPrice = prices[no - 1] * number;// 单价*分数
						double peiSong = (dishPrice > 50) ? 0 : 6;
						double sumPrice = dishPrice + peiSong;
						System.out.println("餐费:" + dishPrice + "元:配送费" + peiSong + ": 总计:" + sumPrice + "元");

						// 并把订餐信息添加到订单信息 插入订单的信息是关键 :i
						names[i] = name;
						dishMsg[i] = dishInfo;
						times[i] = time;
						adresses[i] = address;
						sumPrices[i] = sumPrice;
						break;// 此次订餐结束

					}
				}
				if (!isAdd) {
					System.out.println("对不起,你的餐袋已满!");
				}

				break;
			case 2:
				System.out.println("\n*******查看餐袋********");
				System.out.println("序号\t订餐人\t订餐菜品\t\t配送时间\t配送地址\t\t订餐金额\t订单状态");
				for (int i = 0; i < names.length; i++) {
					if (names[i] != null) { // 输入非空订单信息
						String time = times[i] + "点";
						String state = (states[i] == 0) ? "已预定" : "已完成";// 三目运算符
						System.out.println((i + 1) + "\t" + names[i] + "\t" + dishMsg[i] + "\t" + time + "\t"
								+ adresses[i] + "\t" + sumPrices[i] + "\t" + state);
					}
				}
				break;
			case 3:
				System.out.println("\n*******签收订单********");
				boolean isSign = false;// 签收之前,要判断订单是否存在,boolean
				System.out.println("请输入你要签收的订单编号:");
				int signNo = input.nextInt();
				for (int i = 0; i < names.length; i++) {
					if (names[i] != null && states[i] == 0 && i == signNo - 1) {// 必须满足三者的条件
						// 有订单信息 并别订单状态为预定,并且用户输入的订单号我能找到 ,能签收
						isSign = true;
						states[i] = 1;
						System.out.println("订单签收成功!");
					} else if (names[i] != null && states[i] == 1 && i == signNo - 1) {
						// 有订单信息,并且用户输入的订单我能找的到
						isSign = true;
						// 但是订单状态为已完成,不能签收
						System.out.println("你选择的订单已经完成,不能再次签收!");
					}
				}
				if (!isSign) {
					System.out.println("你选择订单不存在!");
				}
				break;
			case 4:
				System.out.println("\n*******删除订单********");
				boolean isDelete = false;// 删除之前,要判断订单是否存在,boolean
				System.out.println("请输入你要删除的订单编号:");
				int deleteNo = input.nextInt();
				for (int i = 0; i < names.length; i++) {
					if (names[i] != null && states[i] == 0 && i == deleteNo - 1) {// 必须满足三者的条件
						// 有订单信息 并且用户输入的订单编号我能找到
						isDelete = true;
						// 订单信息为已预订,不能删除
						System.out.println("你选择的订单未签收,不能删除");
					} else if (names[i] != null && states[i] == 1 && i == deleteNo - 1) {
						// 有订单信息,并且用户输入的订单我能找的到
						isDelete = true;
						// 并且订单状态为已完成能删除
						// 找到删除订单的位置下标i,把i后面的元素依次往前移动,最后一个数组元素要置空
						// 注意:移动的过程其实把后一个元素往前复制的过程
						// 最后一个元素一定要置空,置空后就可以下新的订单了
						for (int j = i; j < names.length; j++) {
							names[j] = names[j + 1];
							dishMsg[j] = dishMsg[j + 1];
							times[j] = times[j + 1];
							adresses[j] = adresses[j + 1];
							sumPrices[j] = sumPrices[j + 1];
							states[j] = states[j + 1];
						}
						// 最后一个元素一定要置空,置空后就可以下新的订单了
						// null 字符串
						// 单击报错链接 可直接跳到错误行
						names[names.length - 1] = null;
						dishMsg[names.length - 1] = null;
						times[names.length - 1] = 0;
						adresses[names.length - 1] = null;
						sumPrices[names.length - 1] = 0;
						states[names.length - 1] = 0;
						System.out.println("删除订单成功");
					}
				}
				if (!isDelete) {
					System.out.println("你选择订单不存在!");
				}
				break;
			case 5:
				System.out.println("\n*******我要点赞********");
				// 循环显示菜品信息
				System.out.println("序号\t菜名\t单价");
				for (int j = 0; j < dishNames.length; j++) {
					String praise = (praiseNums[j] == 0) ? "" : praiseNums[j] + "赞";
					System.out.println((j + 1) + "\t" + dishNames[j] + "\t" + prices[j] + "\t" + praise);
				}
				System.out.print("请你输入你要点赞的菜品序号:");
				int praiseNo = input.nextInt();
				while (praiseNo < 1 || praiseNo > dishNames.length) {
					System.out.print("本店没有这个菜品,无法点赞!请重新输入一个菜品序号:");
					praiseNo = input.nextInt();
				}
				// 关键点:把那个位置的菜品点赞数+1 点赞菜品的位置=praiseNo-1
				praiseNums[praiseNo - 1]++;
				break;
			case 6:
				// 退出系统
				flag = true;
				break;
			default: // 输入0-6 之外的数字的退出
				// 退出系统
				break;

			}
			if (!flag) { // !flag 等同于!flag=false;
				System.out.print("请输入0返回:");
				num = input.nextInt();
			} else {
				break;// 跳出整个系统的关键
			}
		} while (num == 0);
		System.out.println("谢谢使用,欢迎下次光临!");

	}

}

冒泡排序数字(升序排列)

package day0321;

//冒泡排序数字(升序排列)
public class Test04 {
	public static void main(String[] args) {
		int[] nums = { 16, 25, 9, 90, 23 };
		 for (int num : nums) {
		 System.out.println(num);
		 }
		 //加个空格 即可对称
		 System.out.println(" --------------------冒泡排列-----------------------");
		// 冒泡排序
		for (int i = 0; i < 4; i++) {
			//  for (int i = 0; i < num.lenght-1; i++)
			for (int j = 0; j < 4 - i; j++) {
			//  for (int j = 0; j < num.lenght-1-i; j++)
				// 按照规律比较并交换数字,前面的数字比后面的数字大,就交换
				if (nums[j] > nums[j + 1]) {
					int temp = nums[j];
					nums[j] = nums[j + 1];
					nums[j + 1] = temp;
				}
			}
		}
		for (int num : nums) {
			System.out.println(num);
		}
	}
}

猜数游戏

package day0321;
import java.util.Scanner;
//猜数游戏
public class Test03 {
	public static void main(String[] args) {
		// String 和main 的拼写错误都会导致 不报错,但是运行起来没结果
		int[] list = new int[] { 8, 4, 2, 1, 23, 344, 12 };
		// 循环输出数组元素的值,并求和
		int sum = 0;
		for (int num : list) {
			System.out.println(num);
			sum += num;
		}
		System.out.println("数组元素总和为" + sum);
		System.out.print("请输入想要猜测的数字:");
		while (true) {
			Scanner input = new Scanner(System.in);
			int guess = input.nextInt();
			// 猜测结果
			boolean isCorrect = false;
			for (int num : list) {// 遍历数组元素
				if (num == guess) {
					// 猜测正确
					isCorrect = true;
					break;
				}
			}
			if (isCorrect) {
				System.out.println("恭喜你,你能猜的数字在数列中存在!");
			} else {
				System.out.println("对不起,你猜测的数字不在数列中!");
				System.out.print("请重新输入:");
			}
		}
	}
}

计算出张浩班级30人的JAVA的平均分

package day0321;
import java.util.Scanner;
//计算出张浩班级30人的JAVA的平均分
public class Test01 {
	public static void main(String[] args) {
//纪录张浩班30个同学的成绩
		double[] scores = new double[30];
		double avg = 0;// 平均分
		double sum = 0;// 同学成绩的总分数

		Scanner input = new Scanner(System.in);
		// 使用for循环来遍历数组的元素下标;下标0-数组长度-1
		for (int i = 0; i < scores.length; i++) {
			System.out.println("请输入第" + (i + 1) + "个同学的java成绩");
			scores[i] = input.nextDouble();
			sum += scores[i];

			// for(int i =1;i<=3;i++) {
			// sum=sum+i;//sum+=i ?
		}
		avg = sum / scores.length;
		System.out.println("张浩同学的Java的平均分" + avg);
	}
}

---------------------------------------------------------------------------
package day0321;

import java.util.Scanner;
//传统方式计算出张浩全班同学30人的Java的平均分
public class Test02 {
	public static void main (String [] args) {
		int score = 0;
		int sum =0;
		double avg =0;
		
		Scanner input = new Scanner(System.in);
		 score  = input.nextInt();//前面加int和int score =0 略显多余
        System.out.println("请输入第" + (i + 1) + "个同学的java成绩");
        score = input.nextDouble();
		for(int i =1;i<=30;i++) {
			sum+=score;
		}
		avg=sum/30;
		System.out.println("张浩同学班级Java的平均分成绩:"+avg);
	}
}

package day0326;

import java.util.Scanner;

public class Test01 {
//变量要用多次使用则要写在while循环外面
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int sum = 10000;
		int income2=0;
		String reason2="";
		int outcome3=0;
		String reason3="";
		String str="";
		while (true) {
			System.out.println(" --------------------------家庭收支记账软件-----------------------");
			System.out.println("1.收支明细");
			System.out.println("2.登记收入");
			System.out.println("3.登记支出");
			System.out.println("4.退出");
			System.out.print("请选择(1-4):_");
			
			int choose = input.nextInt();
			switch (choose) {
			
			case 1:
				System.out.println(" --------------------------当前收支明细-----------------------");
				System.out.println("收支\t账户金额\t收支金额\t说明\n");
				System.out.println(str);
				break;
				
			case 2:
				System.out.print("请输入本次收入金额:");
				income2 = input.nextInt();
				System.out.print("请输入本次收入说明:");
				reason2 = input.next();
				System.out.println("-------------------------------------------------------------");
				sum = sum + income2;
                    //这一句很关键
				System.out.println("总金额" + sum);
				str+="收入" + "\t" + sum + "\t" + income2 + "\t" + reason2 + "\n";
                    
				System.out.println();
				break;
				
			case 3:
				System.out.print("请输入本次支出金额:");
				outcome3 = input.nextInt();
				System.out.print("请输入本支出说明:");
				reason3 = input.next();
				System.out.println(sum);
				System.out.println("------------------------------------------------------------");
				sum = sum - outcome3;
				System.out.println("总金额" + sum);
				str+="支出" + "\t" + sum + "\t" + outcome3 + "\t" + reason3 + "\n";
				System.out.println();
				break;
				
			case 4:
				System.out.println("退出");
				break;
			default:
				System.out.print("你输入的编号有误,请重新输入!");
				break;
			}
		}
	}

}

package day0326;

public class Test09 {
	public static void main(String[] args) {
		System.out.println(" 你好 ,世界 ");
		int i = 0;
		int sum = 0;
		for (i = 1; i < 20; i++) {
			if (i % 2 == 0 && i % 3 == 0) {
				System.out.println("能被2和3同时整除的是" + i);
				sum += i;
			}
		}
		// 输出顺序真的很重要,也要看你定义的变量在哪里
		System.out.println("能被和2和3同时整除的数字之和" + sum);

	}
}

100的质数

public class Test01 {
//100的质数
//质数:除了1和其本身能被整除的数字称之为质数
	public static void main(String[] args) {
		int i;
		int j;
		for (i = 2; i < 100; i++) {
			boolean result = false;// 默认bu是质数
			for (j = 2; j < i; j++)
				if (i % j == 0) {
					result = true;
					break;
				}
			if (result == false) {
				System.out.println(i + "是质数");
			}
		}
	}
}
import java.util.Scanner;

public class Test02 {
//输出号码
	public static void main(String[] args) {
		int[] i = new int[5];
		i[0] = 1;
		int[] j = new int[] { 1, 2, 3, 4, 5 };
		System.out.println(j[0]);
		Scanner[] scanners = new Scanner[10];
		scanners[0] = new Scanner(System.in);
	}
public class Test0329 {
//	从键盘读入学生成绩,找出最高分,并输出学生成绩等级。 
//	成绩>=最高分-10 等级为’A’ 
//	成绩>=最高分-20 等级为’B’ 
//	成绩>=最高分-30 等级为’C’ 
//	其余 等级为’D’ 
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		System.out.print("请输入学生人数:");
		int num = input.nextInt();

		int[] score = new int[num];
		int max = 0;
		for (int i = 0; i < score.length; i++) {
			System.out.print("请输入" + (i + 1) + "个成绩");
			score[i] = input.nextInt();
			if (score[i] > max) {
				max = score[i];
			}
		}
		System.out.println(max);
		for (int i = 0; i < score.length; i++) {
			if (score[i] >= max - 10) {
				System.out.println("第" + (i + 1) + "学生成绩为A");
			} else if (score[i] >= max - 20) {
				System.out.println("第" + (i + 1) + "学生成绩为B");
			} else if (score[i] >= max - 30) {
				System.out.println("第" + (i + 1) + "学生成绩为C");
			} else {
				System.out.println("第" + (i + 1) + "学生成绩为D");
			}
		}
	}
}
package day0321;

import java.util.Scanner;

public class Test10 {
//数组中插入元素
	public static void main(String[] args) {
		// 通过数组存储原来的5个成绩
		// 数组的长度是固定的,一旦定义无法修改
		// int[] list = {99,85,82,63,60};
		int[] list = new int[6];
		list[0] = 99;
		list[1] = 85;
		list[2] = 82;
		list[3] = 63;
		list[4] = 60;
		// 获取用户要插入的数值
		Scanner input = new Scanner(System.in);
		System.out.println("请输入你要插入的数值:");
		int num = input.nextInt();
		// 找到num要插入的位置index(很经典)
		int index = 0;
		for (int i = 0; i < list.length; i++) {
			if (num > list[i]) {
				index = i;
				break;
			}
		}
		// 原index位置及以后的所有数据
		for (int i = list.length; i > index; i--) {
			list[i] = list[i-1]; // list[5]=list[4]
		}
		// inex位置将num插入进来
		list[index] = num;
		System.out.println("插入成绩的下标是" + index);
		System.out.println("插入数值后的最后成绩是:");
		for (int listNum : list) {
			System.out.println(listNum + "\t");
		}

	}

}

杨辉三角

package day0330;

public class Test01 {
//杨辉三角 
	public static void main(String[] args) {
		//声明数组
				int[][] arr = new int[10][]; 
				//初始化数据组
//				arr[0]=new int[1];
//				arr[1]=new int[2];
//				arr[2]=new int[3];
//				arr[3]=new int[4];
//				arr[4]=new int[5];
//				arr[5]=new int[6];
//				arr[6]=new int[7];
//				arr[7]=new int[8];
//				arr[8]=new int[9];
//				arr[9]=new int[10];
				
				for(int i=0;i<arr.length;i++) {
					arr[i]=new int[i+1];
				}
				

				//每行第一个元素是1 最后一个元素1
//				arr[0][0]=1;
//				arr[1][0]=1;
//				arr[2][0]=1;
//				arr[3][0]=1;
//				arr[4][0]=1;
//				arr[5][0]=1;
//				arr[6][0]=1;
//				arr[7][0]=1;
//				arr[8][0]=1;
//				arr[9][0]=1;
//				arr[0][0]=1;
//				arr[1][1]=1;
//				arr[2][2]=1;
//				arr[3][3]=1;
//				arr[4][4]=1;
//				arr[5][5]=1;
//				arr[6][6]=1;
//				arr[7][7]=1;
//				arr[8][8]=1;
//				arr[9][9]=1;
				for (int i = 0; i < arr.length; i++) {
					arr[i][0]=1;
					arr[i][i]=1;
				}
				
				第三行
//				arr[2][1]=arr[1][1]+arr[1][0];
//				//第四行
//				arr[3][1]=arr[2][1]+arr[2][0];
//				arr[3][2]=arr[2][2]+arr[2][1];
//				
//				//第五行
//				arr[4][1]=arr[3][1]+arr[3][0];
//				arr[4][2]=arr[3][2]+arr[3][1];
//				arr[4][3]=arr[3][3]+arr[3][2];
				//从第三行开始,非首末元素是上一行正对的元素+上一行正对元素的上一个元素
				for (int i = 2; i < arr.length; i++) {
					for (int j = 1; j < i; j++) {
						arr[i][j]=arr[i-1][j]+arr[i-1][j-1];
					}
				}
				
				//显示
				for (int i = 0; i < arr.length; i++) {
					for (int j = 0; j < arr[i].length; j++) {
						System.out.print(arr[i][j]+"\t");
					}
					System.out.println();
				}
				
	}

}
class Test02{
	public static void main(String[] args) {
		//声明变量
		int  [][] arr = new int [10][];
		//初始化变量
		for (int i = 0 ;i<arr.length;i++) {
			arr[i]=new int [i+1];
			
		}
		//每行第一个元素是1 最后一个元素1
		for(int i = 0; i < arr.length; i ++) {
			arr[i][0]=1;
			arr[i][i]=1;
		}
		//从第三行开始,非首末元素是上一行正对的元素+上一行正对元素的上一个元素
		for (int i = 2 ;  i < arr.length;i++) {
			for(int j = 1; j < i ; j++) {
				//  规律   32  22  21 
				arr[i][j] = arr [i-1][j] + arr[i-1][j-1]; 
			}
		}
		for(int i = 0; i < arr.length;i++) {
			for(int j = 0 ; j < arr[i].length;j++) {
				System.out.print(arr[i][j]+"\t");
				
			}
			System.out.println();
		}
	}
	
}

随机生成几个数并比较其最大和最小

class Test29 {
    //随机生成几个数并比较其最大和最小
	public static void main(String[] args) {
		int[] arr = new int[6];
		for (int i = 0; i < arr.length; i++) {
			while (true) {
				int n = (int) (Math.random() * 30 + 1);
				// 如何统计随机数出现的次数
				int count = 0;
				for (int j = 0; j < arr.length; j++) {
					if (arr[j] == n) {
						count++;
					}
				}
				if (count == 0) {
					arr[i] = n;
					break;
				}
			}
		}
		for (int i = 0; i < arr.length; i++) { // 此处循环是输出 输出数组都要用for 循环
			System.out.println(arr[i]);
		}
		int max = arr[0] ;
		int min = arr[0] ;
		for (int i = 0;i < arr.length; i++) {
			
			if(arr[i] > max) {
				max=arr[i];
			}if(arr[i] < min) {
				min=arr[i];
			}
		}
		System.out.println("最大值"+max);
		System.out.println("最小值"+min);
	}
}

创建一个char类型的26个元素的数组,分别 放置’A’-‘Z’。使用for循环访问所有元素并打印出来

class Number {
	// 创建一个char类型的26个元素的数组,分别 放置'A'-'Z'。使用for循环访问所有元素并打印出来。
    public static void main(String[] args){
        char[] chars = new char[26];
        //int index = 0;
 
        //for (char i = 'A'; i < 'Z'; i++){
        //    chars[index] = i;
        //    index++;
        //}
 
        for (int i = 0; i < chars.length; i++){
            //'A' + i 表达式的结果是int类型,需要强制转换为char类型
            //byte,short,char在参与算数运算时,会自动转为int类型,单独计算也是(重点)
            //char c1 = 'a'; char c2 = 'b'; int i1 = c1 + c2;(这里不能使用char类型变量接收结果)
            chars[i] = (char)('A' + i);
            System.out.print(chars[i]);
        }
 
      //  for (char aChar : chars) {
      //  }
 
    }
}


二分法的查找

package day0330;
public class Test5 {
//二分法的查找
	public static void main(String[] args) {
		//熟记语法的规则
		int [] array = new int [] {0,1,6,7,12,9,5};
		int start = 0;
		int num = 7;
		int end = array.length-1;
		boolean isFlag = false; 
		//开始和结尾的下标
		while(start <= end ) {
			int middle = (start + end)/2;	
			if (array[middle] == num) {
				System.out.println("找到指定的元素:"+middle);
				isFlag =true;
				break;
			}else if (array[middle] >num) {
				end = middle-1;
			}else {
				start = middle +1;
			}
		}
		if(isFlag==false) {
			System.out.println("未找到指定的元素");
		}
		
	}

}

类和对象的使用

package day0331;
import java.util.Arrays;
//类和对象的使用
public class Animal {
	String name;
	int weight;
	int height;
	String sex;
	int age;
	String[] hobbiys;// 多种爱好

	public void showInfo() {
		System.out.println("姓名:" + name);
		System.out.println("体重:" + weight);
		System.out.println("身高:" + height);
		//解决数组的输出
		System.out.println(Arrays.toString(hobbiys));
	}
}


package day0331;
//测试类  启动类
public class Test02 {

	public static void main(String[] args) {
		Animal A1 = new Animal();//引用数据的固定语法(new一个对象)
		A1.name ="狗子";
		A1.sex = "公";
		A1.height= 23;
		A1.weight =89;
		A1.hobbiys= new String [2];
		A1.hobbiys[0]="吃";
		A1.hobbiys[1]="喝";
		A1.showInfo();
	}
}

对象数组

package day0331;
import java.util.Arrays;
public class Test10 {
		public static void main(String[] args) {
			//对象数组,存放学生对象
			Student[] stus=new Student[20];
			//初始化学生数组
			for (int i = 0; i < stus.length; i++) {
				stus[i]=new Student();   //借助了中间变量
				stus[i].number=i+1;
				stus[i].state=(int)(Math.random()*5+1);
				stus[i].score=(int)(Math.random()*101);
			}
			
			//打印三年级的学生信息
//			for (int i = 0; i < stus.length; i++) {
//				if (stus[i].state==3) {
//					stus[i].show();
//				}
//			}
			showStudents(stus, 3);
			
			//冒泡排序
			for (int i = 0; i < stus.length-1; i++) {
				for (int j = 0; j < stus.length-1-i; j++) {
					if (stus[j].score>stus[j+1].score) {
						Student stu=stus[j];
						stus[j]=stus[j+1];
						stus[j+1]=stu;
					}
				}
			}
			System.out.println("----------------------------------------------------");
			//打印排序后的所有学生信息
//			for (int i = 0; i < stus.length; i++) {
//				stus[i].show();
//			}
			showStudents(stus, -1);
		}
		
		/**
		 * 
		 * @param stus 要显示的学生数组
		 * @param nianJi 年级  如果传入一个负数则打印全部
	 	 */
		public static void showStudents(Student[] stus,int nianJi) {
			for (int i = 0; i < stus.length; i++) {
				if (nianJi<0) {
					stus[i].show();
				}else {
					if (stus[i].state==nianJi) {
						stus[i].show();
					}
				}
			}
		}
	}



传地址

package day0402;
//传地址
public class Test03 {
		public static void swap(DataSwap ds) {
			int temp = ds.a;
			ds.a = ds.b;
			ds.b = temp;
			System.out.println("swap方法里,a Field的值是" + ds.a + ";b Field的值是" + ds.b);  //a=10 b=5
		}
		public static void main(String[] args) {
			DataSwap ds = new DataSwap();
			ds.a = 5;
			ds.b = 10;
			swap(ds);
			System.out.println("交换结束后,a Field的值是" + ds.a + ";b Field的值是" + ds.b); //a=10 b=5
		} 
	}
	class DataSwap {
		public int a;
		public int b; 
	}

封装

package day0402;
//封装
public class Test05 {
	private int legs;

	public void setlegs(int legs) {
		//限制用户输入的数值
		if (legs < 0 || legs > 750) {
			this.legs = 4;
		} else {
			this.legs = legs;
		}
	}

	public void show() {
		System.out.println("这个动物有"+legs+"腿");
	}
}


package day0402;
public class Test051 {
//测试封装
	public static void main(String[] args) {
		
		Test05 animal = new Test05();
		
		animal.setlegs(100000);
		
		animal.show();
	}

}

递归

package day0402;
public class Test04 {
//递归
	public static void main(String[] args) {
		//实例化
		Test04 test=new Test04();
		int sum= test.sum(5);
		
		
		System.out.println(sum);
		
	}
	//删除static 	
	public      int sum(int num) {
		if (num == 1) {
			return 1;
		} else {
			return num + sum(num - 1);
		}
	}

}

public class Product {
	int id;
	String name;
	double money;
	}
------------------------------------------------------------------------------------------------	
import java.util.Scanner;

public class ProductManage {

	Product[] products = new Product[20];

	public void init() {
		// 向数组products 添加默认三个商品对象
		Product P1 = new Product();

		P1.id = 1;
		P1.name = "方便面";
		P1.money = 5;
		products[0] = P1;

		Product P2 = new Product();
		P2.id = 2;
		P2.name = "矿泉水";
		P2.money = 5;
		products[1] = P2;

		Product P3 = new Product();
		P3.id = 3;
		P3.name = "百岁山";
		P3.money = 2;
		products[2] = P3;

	}

	public void showProducts() {
		// 商品详情方法
		System.out.println();
		System.out.println("商品编号" + "\t" + "商品名称" + "\t" + "商品价格");
		for (int i = 0; i < products.length; i++) {
			if (products[i] != null) {
				System.out.println(products[i].id + "\t" + products[i].name + "\t" + products[i].money);
			}

		}
	}

   //增加商品方法
	public void addProduct() {
		Scanner input = new Scanner(System.in);
		Product p = new Product();
		boolean isExists = false;//默认不存在
		int id=0;
		//验证新添加商品编号是否存在
		do {
			isExists=false;//标识商品编号 初始化是未重复
			System.out.println("商品编号");
			id = input.nextInt();
			for (Product item : products) {
				if (item != null) {
					if (item.id == id) {
						isExists = true;//存在
						System.out.println("已存在该商品编号,请重新输入");
						break;
					}
				}
			}
			
		}while(isExists);
        p.id=id;//给商品编号赋值
		System.out.println("商品名称");
		p.name = input.next();
		System.out.println("商品价格");
		p.money = input.nextDouble();
		//找到数组空位置将新商品加入
		for (int i = 0; i < products.length; i++) {
			if (products[i] == null) {
				products[i] = p;
				break;
			}
		}
		System.out.println("添加成功");

	}

}

-----------------------------------------------------------------------------------------------------
import java.util.Scanner;

public class ProductTest {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		ProductManage pm = new ProductManage();
		boolean flag = true;
		pm.init();//初始化数据
		do {
			System.out.println("*********欢迎来到课工场超市管理系统*******");
			System.out.println("\t1.查看商品详情");
			System.out.println("\t2.添加商品");
			System.out.println("\t3.退出");
			System.out.println("请输入您选择的菜单");
			int num = input.nextInt();
			switch (num) {
			case 1:
                pm.showProducts();
				break;
			case 2:
				pm.addProduct();
				break;
			case 3:
				flag=false;
				System.out.println("谢谢惠顾");
				break;
			}
		} while (flag);
	}

}

	
package day0321;

import java.util.Scanner;

public class Test10 {
//数组中插入元素
	public static void main(String[] args) {
		// 通过数组存储原来的5个成绩
		// 数组的长度是固定的,一旦定义无法修改
		// int[] list = {99,85,82,63,60};
		int[] list = new int[6];
		list[0] = 99;
		list[1] = 85;
		list[2] = 82;
		list[3] = 63;
		list[4] = 60;
		// 获取用户要插入的数值
		Scanner input = new Scanner(System.in);
		System.out.println("请输入你要插入的数值:");
		int num = input.nextInt();
		// 找到num要插入的位置index
		int index = 0;
		for (int i = 0; i < list.length; i++) {
			if (num > list[i]) {
				index = i;
				break;
			}
		}
		// 原index位置及以后的所有数据
		for (int i = list.length-1; i > index; i--) {
			list[i] = list[i-1]; // list[5]=list[4]
		}
		// inex位置将num插入进来
		list[index] = num;
		System.out.println("插入成绩的下标是" + index);
		System.out.println("插入数值后的最后成绩是:");
		for (int listNum : list) {
			System.out.print(listNum + "\t");
		}

	}

}

输入三位随机数比大小

package day0325;
import java.util.Scanner;
//输入三位随机数比大小
public class Test02 {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		System.out.println("请随机输入三位数字:");
		int num1 = input.nextInt();
		int num2 = input.nextInt();
		int num3 = input.nextInt();
		if (num1 > num2 && num1 > num3) {
			if (num2 > num3) {
				System.out.println(num1 + ">" + num2 + ">" + num3);
			}

		} else if (num2 > num1 && num2 > num3) {
			if (num1 > num3) {
				System.out.println(num2 + ">" + num1 + ">" + num3);
			}

		} else if (num3 > num1 && num3 > num2) {
			if (num1 > num2) {
				System.out.println(num3 + ">" + num1 + ">" + num2);
			}
		}

	}
}
package day0325;
import java.util.Scanner;
public class Test05 {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		System.out.println("请输入两个数字");
		int num1 = input.nextInt();
		int num2 = input.nextInt();
		int max = num1 > num2 ? num1 : num2;
		int min = num1 > num2 ? num2 : num1;
		// System.out.println("最大"+num1);
		// System.out.println("最小"+num2);
		for (int i = min; i >= 1; i--) {
			if (num1 % i == 0 && num2 % i == 0) {
				System.out.println("最大公约数" + i);
				break;
			}
		}
		for (int i = max; i <= num1 * num2; i++) {
			if (i % num1 == 0 && i % num2 == 0) {
				System.out.println("最小公倍数" + i);
				break;
			}
		}
	}
}
package day0325;

import java.util.Scanner;
//如何用异常处理用户输入错误
public class Test08 {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		System.out.println("请输入年:");
		int year = input.nextInt();
		System.out.println("请输入月:");
		int month = input.nextInt();
		System.out.println("请输入日:");
		int day = input.nextInt();
		int days = day;
		//int sum = 0;
		//int twoMonth = (year / 400 == 0) ? 29 : 28;
		//if (twoMonth == 29) {
		//	System.out.println("2月为闰年");
		//}
		switch (month) {
		case 12:
			days+=30;
		case 11:
			days+=31;
		case 10:
			days+=30;
		case 9:
			days+=31;
		case 8:
			days+=30;
		case 7:
			days+=31;
		case 6:
			days+=30;
		case 5:
			days+=31;
		case 4:
			days+=30;
		case 3:
			days+=31;
		case 2:
			if((year/4==0&&year!=0)||year/400==0) {
				day++;
				days+=day;
			}else 
			days+=28;
		}
		System.out.println(year + "年" + month + "月" + day + "日是这一年的第" + days + "天");
	}
}

package day0325;
import java.util.Scanner;
public class Test {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		char i = input.next().charAt(0);
		i=(char)(i-32);
		System.out.println("i");
		//switch (i) {
		//case 'a':
			System.out.println("A");
		}
	}
package day0326;

import java.util.Scanner;
//统计输入整数的正负的个数
public class Test04_1 {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		System.out.println("请输入整数的个数:");
		int total = input.nextInt();
		int num = 0;
		int i = 0;// 统计正数的个数
		int j = 0;// 统计负数的个数
		for (int k = 1; k <= total; k++) {
			System.out.println("请输入第" + k+ "个整数:");
			num = input.nextInt();
			if (num > 0) {
				i++;

			} else if (num < 0) {
				j++;

			} else if (num == 0) {
				
			}
		}
		System.out.println(i);
		System.out.println(j);
	}
}

  public class Number {
	// 创建一个char类型的26个元素的数组,分别 放置'A'-'Z'。使用for循环访问所有元素并打印出来。
    public static void main(String[] args){
        char[] chars = new char[26];
        //int index = 0;
 
        //for (char i = 'A'; i < 'Z'; i++){
        //    chars[index] = i;
        //    index++;
        //}
 
        for (int i = 0; i < chars.length; i++){
            //'A' + i 表达式的结果是int类型,需要强制转换为char类型
            //byte,short,char在参与算数运算时,会自动转为int类型,单独计算也是(重点)
            //char c1 = 'a'; char c2 = 'b'; int i1 = c1 + c2;(这里不能使用char类型变量接收结果)
            chars[i] = (char)('A' + i);
            System.out.print(chars[i]);
        }
 
      //  for (char aChar : chars) {
      //  }
 
    }
}
package day0331;

public class ZhaZhiJi {
//方法:榨汁  -前提   水果- 形式参数:参数类型   参数名称
	public  void zhaZhi(String fruit , int num) {
		System.out.println(num+"杯"+fruit+"汁");

	}
	//public  string zhaZhi(String fruit , int num) {
	//	return num +"杯"+fruit+"汁";   方法有没有参数和方法有没有返回值是两码事
		
	//}

}




-------------------------------------------------------------------------
package day0331;
//测试类
import java.util.Scanner;

public class TestZhaZhi {
	public static void main(String[] args) {
		ZhaZhiJi ji = new ZhaZhiJi();
		Scanner input = new Scanner(System.in);
		System.out.println("请输入水果:");
		String shuiGuo = input.next();
		System.out.println("几杯:");
		int num = input.nextInt();
		// 实际参数
		// 实参和形参 的变量名可以不一样,类型一致就OK.
		ji.zhaZhi(shuiGuo, num);
	}
}


package cn.kgc.yichang;
//需回顾
public class EcmDef {
	public static void main(String[] args) {
		try {
			String str1 = args[0];
			String str2 = args[1];

			int num1 = Integer.parseInt(str1);
			int num2 = Integer.parseInt(str2);

			EcmDef ecmDef = new EcmDef();
			ecmDef.ecm(num1, num2);

		} catch (ArithmeticException e) {
			System.err.println(e.getMessage());
		} catch (MyException e) {//手动定义的 
			
			System.err.println(e.getMessage());
		} catch (NumberFormatException e) {
			System.err.println("转化失败");
		} catch (ArrayIndexOutOfBoundsException e) {
			System.err.println("数组越界");
		} catch (Exception e) {
			System.err.println("未知异常");
		}

	}

	public void ecm(int num1, int num2) throws MyException {
		try {
			if (num1 < 0 || num2 < 0) {
				throw new MyException("不能为负数");
			}
			int result = num1 / num2;
			System.out.println(result);

		} catch (ArithmeticException e) {//计算错误
			throw e;
		} catch (Exception e) {
			throw e;
		}

	}
}

public class StudentMgs {

	List<Empoyee> list = new ArrayList<Empoyee>();

	public void init() {
		list.add(new Student("张小三", 18, 660));
		list.add(new Teacher("张三", 25, 10000));
		list.add(new Student("李小四", 17, 880));
		list.add(new Teacher("李四", 34, 15000));
	}
	public void show() {
		for (Empoyee empoyee : list) {
			System.out.println(empoyee.getInfo());
		}
	}

	public void sort() {
		Collections.sort(list);// 在父类里直接写比较接口
		for (Empoyee empoyee : list) {
			System.out.println(empoyee.getInfo());
		}

	}
	public void play(String name) {
		for (Empoyee employee : list) {
			if (employee.getName().equals(name)) { 
				System.out.println(employee.getInfo());
				System.out.println(employee.play());
			}
		}
	}
}

package day0422;

import java.util.ArrayList;
import java.util.List;
public class Employee {
	// 普通方法,把数组转集合
	public List<String> getList(String[] array) {
		List<String> list = new ArrayList<String>();
		for (String string : array) {
			list.add(string);
		}
		return list;
	}

	// 把方法 把数组转换成集合
	public <T> List<T> getList02(T[] array) {
		List<T> list = new ArrayList<T>();
		for (T string : array) {
			list.add(string);
		}
		return list;
	}

	// 静态泛型方法,把数组转换集合
	public static <T> List<T> getList03(T[] array) {
		List<T> list = new ArrayList<T>();
		for (T string : array) {
			list.add(string);
		}
		return list;
	}
}

提取想要的关键字

package day0421;
import java.awt.List;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

import org.junit.jupiter.api.Test;
//提取想要的关键字
public class Test01 {
	public static void main(String[] args) {
		Properties properties = new Properties();
		try {
			FileInputStream fileInputStream = new FileInputStream("E:/jdbc.properties");
			//txt的后缀直接更换为properties
			properties.load(fileInputStream);
			System.out.println(properties.get("name"));
			System.out.println(properties.get("age"));
			System.out.println(properties.get("sex"));
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		
	}
@Test
	public void test01() {
	ArrayList<Integer> list = new ArrayList();
	list .add(4);
	list .add(2);
	list .add(2);
	list .add(9);
	
//	Collections.shuffle(list);
//	System.out.println(list);
//	System.out.println("=========");
//	int count = Collections.frequency(list,9);
//	System.out.println(count);
	
	for(Integer integer:list) {
		integer++;
		System.out.println(integer);
	}
	
	Map<String ,Integer> map = new HashMap<>();
	map.put("Tom",87);
	map.put("Jerry",82);
	map.put("Jack",83);
	
	//泛型的嵌套
	Set<Map.Entry<String,Integer>>entry = map.entrySet();
	Iterator<Map.Entry<String,Integer>> iterator= entry.iterator();
	while (iterator.hasNext()) {
		Map.Entry<String, Integer> entry2 =  iterator.next();
		String key = entry2.getKey();
		Integer value = entry2.getValue();
		System.out.println(key+"-----"+value);
		}
	}
}

package day0423;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.imageio.stream.FileImageInputStream;
import javax.imageio.stream.ImageInputStream;
import org.junit.jupiter.api.Test;
public class Test01 {
	@Test
	public void test() {
		File file2 = new File("E:\\otherFile\\hello.txt"); // 直接放项目里 不用放包里
		System.out.println(file2.exists());
		System.out.println(new SimpleDateFormat("yyyy-MM-dd").format(new Date(file2.lastModified())));
		file2.renameTo(new File("E:\\otherFile\\hello2.txt"));
		// 创建文件
		File file3 = new File("E:\\otherFile\\otherFile1.txt"); 
		try {
			System.out.println(file3.createNewFile());
		} catch (IOException e) {
			
			e.printStackTrace();
		}
		//创建 word文件
		File file4 = new File("E:\\otherFile\\hello45.docx"); 
		try {
			System.out.println(file4.createNewFile());
		} catch (IOException e) {
			
			e.printStackTrace();
		}
		//创建文件夹
		File file5 = new File("E:\\otherFile\\hello45"); 
			System.out.println(file5.mkdir());
			
		//如何批量创建升序文件夹  	
		for(int i = 4200 ; i < 4210 ;i++) {
			File file6 = new File("E:\\otherFile\\1103-0702-2020-"+i); 
			System.out.println(file6.mkdir());	
			}
		//创建 xlsx文件
				File file6 = new File("E:\\otherFile\\hello46.xlsx"); 
				try {
					System.out.println(file6.createNewFile());
				} catch (IOException e) {
					e.printStackTrace();
					}
		//创建 pptx文件
		File file7 = new File("E:\\otherFile\\hello46.pptx"); 
		try {
			System.out.println(file7.createNewFile());
		} catch (IOException e) {
			e.printStackTrace();
		}
		//创建根目录文件夹
		File file8 = new File("E:\\otherFile\\hello\\hello46.pptx"); 
			System.out.println(file8.mkdirs());
		
			
			
			
			//列出当前目录下全部java文件的名称  File files  String  endWith
	}

	@Test
	// 字节流
	public void test01() {
		// 声明对象
		File file = new File("E:\\otherFile\\hello2.txt");
		// 声明流对象
		FileInputStream inputStream = null;// 作用域
		try {
			// 初始化流对象
			inputStream = new FileInputStream(file);
			// 声明缓冲数组
			byte[] data = new byte[1024];// 1 0 0 0 0 0 0 //中文最好不使用字节流
			// 循环读取
			int read = inputStream.read(data);// 读取数组的长度 -1 读取数据的长度 -1文件中没内容 1024数组读满了 read=1
			while (read != -1) {
				String str = new String(data, 0, read, "UTF-8");// 好好理解
				System.out.println(str);//
				read = inputStream.read(data);// read= -1;
			}

		} catch (Exception e) {// 报导包的异常
			e.printStackTrace();
		} finally {

			try {
				// 关闭流
				inputStream.close();
			} catch (IOException e2) {
				e2.printStackTrace();
			}

		}
	}

	@Test
	public void Test02() {
		// 字符流
		File file = new File("E:\\otherFile\\hello3.txt");
		// 声明流对象
		Reader reader = null;// 作用域
		try {
			// 初始化流对象
			reader = new FileReader(file);
			// 声明缓冲数组
			char[] data = new char[1024];// 1 0 0 0 0 0 0 //中文最好不使用字节流
			// 循环读取
			int read = reader.read(data);// 读取数组的长度 -1 读取数据的长度 -1文件中没内容 1024数组读满了 read=1
			while (read != -1) {
				String str = new String(data, 0, read);// 好好理解        (构造方法)
				System.out.println(str);//
				read = reader.read(data);// read= -1;
			}

		} catch (Exception e) {// 报导包的异常
			e.printStackTrace();
		} finally {

			try {
				// 关闭流
				reader.close();
			} catch (IOException e2) {
				e2.printStackTrace();
			}

		}

	}
}

package day0425_01;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import org.junit.jupiter.api.Test;

public class Test01 {
//序列化
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		User user = new User("张三", 23);
		File file = new File("E:\\USER.bat");
		FileOutputStream fileOutStream = null;
		ObjectOutputStream objectOutput = null;
		try {
			fileOutStream = new FileOutputStream(file);
			objectOutput = new ObjectOutputStream(fileOutStream);

		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		} finally {
			try {
				objectOutput.flush();
				fileOutStream.flush();
				objectOutput.close();
				fileOutStream.close();

			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
	@Test//反序列化    
	public void test01() {
		File file  = new File("E:\\USER.bat");
		FileInputStream inputStream= null;
		ObjectInputStream objectInputStream= null;
		try {
			inputStream= new  FileInputStream(file);
			objectInputStream = new ObjectInputStream(inputStream);
			User user =(User) objectInputStream.readObject();
			System.out.println(user.getName()+"\t"+user.getAge());
		} catch (Exception e) {
			// TODO: handle exception
		} finally {
			try {
				objectInputStream.close();
				inputStream.close();
			} catch (Exception e2) {
				// TODO: handle exception
			}
		}
	}
}

package day0416;

//String buffer    String biuld 
public class Test02 {
	public static void main(String[] args) {
//		StringBuffer append(xxx):提供了很多的append()方法,用于进行字符串拼接
//		StringBuffer delete(int start,int end):删除指定位置的内容
//		StringBuffer replace(int start, int end, String str):把[start,end)位置替换为str
//		StringBuffer insert(int offset, xxx):在指定位置插入xxx
//		StringBuffer reverse() :把当前字符序列逆转
//		public int indexOf(String str)  
//		int indexOf(String str):返回指定子字符串在此字符串中第一次出现处的索引
//		 int indexOf(String str, int fromIndex):返回指定子字符串在此字符串中第一次出现处的索引,从指定的索引开始

//		public String substring(int start,int end)
//		public int length()
//		public char charAt(int n )
//		public void setCharAt(int n ,char ch)   //添加功能
		
		StringBuffer  buffer = new StringBuffer("wertyu");
		buffer.append("12365");
		System.out.println(buffer);
		
		StringBuffer  buffer2 = new StringBuffer("dfghj");
		buffer2.charAt(2);
		System.out.println(buffer2);
		
		StringBuffer  buffer3 = new StringBuffer("dzxcvbn");
		buffer3.insert(4,"Y");
		System.out.println(buffer3);
		
		StringBuffer  buffer4 = new StringBuffer("dzxcvbn");
		buffer4.reverse();
		System.out.println(buffer4);
		
		StringBuffer  buffer5 = new StringBuffer("dzxcvbn");
		buffer5.setCharAt(4,'E');
		System.out.println(buffer5);
		
		StringBuffer  buffer6 = new StringBuffer("dzxcvbn");
		buffer5.indexOf("c",4);
		System.out.println(buffer6);
		
		System.out.println("取得范围是:"+new StringBuffer("dzxcvbn").substring(1, 5));
		System.out.println("字符串的长度是::"+new StringBuffer("dzxcvbn").length());
		System.out.println("替换的字符是::"+new StringBuffer("dzxcvbn").replace(1,2,"征"));
		
		
		
		 String s = "findStrring";  //定义初始化一个字符串findString
	       // 从头开始查找是否存在指定的字符         //结果如下   
	       System.out.println(s.indexOf("d"));     // 结果是3  
	       // 从第四个字符位置开始往后继续查找S,包含当前位置  
	      System.out.println(s.indexOf("S"));  //结果是4  
	      //若指定字符串中没有该字符则系统返回-1  
	      System.out.println(s.indexOf("o"));     //结果是-1  
	     //从指定的索引处开始向后搜索,返回在此字符串中最后一次出现的指定子字符串的索引
	    System.out.println(s.lastIndexOf("r")); //结果是7 

	}
	
}

三天打鱼两天晒网,从1990-1-1开始,今天打鱼还是晒网

package day0416;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

//三天打鱼两天晒网,从1990-1-1开始,今天打鱼还是晒网
//分析  一共五天   
public class Test04 {

	public static void main(String[] args) {
		long currentTimeMillis = System.currentTimeMillis();
		System.out.println(currentTimeMillis);

		Date date1 = new Date(); 
		System.out.println(date1.toString()); 
		System.out.println(date1.getTime()); 
		
    	Date date2 = new Date(date1.getTime()); 
		System.out.println(date2.getTime()); 
		System.out.println(date2.toString());

		SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
		Date date=new Date();
		Date date2 = null;
		try {
			date2 = simpleDateFormat.parse("1990-1-1");
		} catch (ParseException e) {
		
			e.printStackTrace();
		}
		long days=(date.getTime()-date2.getTime())/(1000*60*60*24)+1;
		
		if(days%5<=3&&days%5>=1) {
			System.out.println("打鱼");
		}else {
			System.out.println("晒网");
		}

		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd  HH:mm:ss");
		Date date = new Date();
		String dateStr = format.format(date);
		System.out.println(dateStr);
		
		
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		try {
			Date date4 = format.parse("2020-01-01 1:1:1");
			java.sql.Date sqlDate=new java.sql.Date(date4.getTime());
			System.out.println(sqlDate);

		} catch (ParseException e) {
			e.printStackTrace();

		}

	}

}

多线程

package cn.kgc.java.demo.thread;
//多线程
public class TestThread {
	public static void main(String[] args) {
		MyThread myRunable = new MyThread();
		myRunable.setName("偶数:");
		myRunable.start();
		
		Thread.currentThread().setName("奇数:");
		for (int i = 0; i < 100; i++) {
			if(i%2!=0){
				System.out.println(Thread.currentThread().getName()+i);
				if (i == 21) {
				try {
					myRunable.join();
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
			
		}
		//System.out.println(myRunable.isAlive());
	}
}
}

-----------------------------------------------------------------------------------------------------



package cn.kgc.java.demo.thread;//thread 在lang 包中

public class MyThread extends Thread {
	@Override
	public void run() {
		for (int i = 0; i <= 100; i++) {
			if (i % 2 == 0) {

				System.out.println(Thread.currentThread().getName() + i);
			}
		}
	}
}
package cn.kgc.homework;
//Runnable 多线程技术
public class MyRunable01 implements Runnable {
	int tick = 100;
	// Object object = new Object();

	@Override
	public void run() {
		while (tick > 0) {
			show();
		}
	}
	// 使用同步方法解决Runnable接口的线程安全
	public synchronized void show() {
		if (tick > 0) {
			System.out.println(Thread.currentThread().getName()+ "\t"+ "票数:" + tick);
			tick--;
		}

	}
}
---------------------------------------------------------------
package cn.kgc.homework;

public class TestMyrunnable01 {

	public static void main(String[] args) {
		
		MyRunable01 myRunnable = new MyRunable01();
		Thread thread1 = new Thread(myRunnable,"窗口一");
		Thread thread2 = new Thread(myRunnable,"窗口二");
		Thread thread3 = new Thread(myRunnable,"窗口三");
		
		thread1.start();
		thread2.start();
		thread3.start();
		
	}

}

ReentrantLock,可以显式加锁、释放锁

import java.util.concurrent.locks.ReentrantLock;

//ReentrantLock,可以显式加锁、释放锁
public class MyThread01 {
	static int tick = 100;
	static Object object = new Object();
	static ReentrantLock lock = new ReentrantLock(true);

	public void run() {
		synchronized (object) {
			try {
				lock.lock();
				while (true) {
					if (tick > 0) {
						System.out.println(Thread.currentThread().getName() +"\t" + "票数是:" + tick);
						tick--;

					} else {
						break;
					}
				}
			} finally {
				lock.unlock();
			}

		}
	}

}
---------------------------------------------------------------------
package cn.kgc.homework;

public class TestMythread01 {
	private void mian() {
		// TODO Auto-generated method stub
		MyThread myThread1 = new MyThread();
		myThread1.setName("窗口二");
		myThread1.start();
		
		MyThread myThread2 = new MyThread();
		myThread2.setName("窗口三");
		myThread2.start();
		
		MyThread myThread3 = new MyThread();
		myThread3.setName("窗口一");
		myThread3.start();
		
	}
}

package cn.kgc.homework;

public class MyThread extends Thread {
	static  int tick = 100;
	static Object object = new Object();
	@Override
	public void run() {
		while (true) {
			synchronized (object) {
				if(tick>0) {
					//Thread.currentThread().getName()
					System.out.println(Thread.currentThread().getName()+"票数是:"+tick);
					tick--;
					
				}else {
					break;
				}
			}
		}
	}
}
-------------------------------------------------------------------------------------------
package cn.kgc.homework;


public class TestMyThread {
	public static void main(String[] args) {
		MyThread myThread1 = new MyThread() ;
		myThread1.setName("窗口一");
		myThread1.start();
		
		MyThread myThread2 = new MyThread();
		myThread2.setName("窗口二");
		myThread2.start();
		
		MyThread myThread3 = new MyThread();
		myThread3.setName("窗口三");
		myThread3.start();
		
	}

}

package day0415;

public class Test01 {

	public static void main(String[] args) {
//		int length():返回字符串的长度: return value.length
//		char charAt(int index): 返回某索引处的字符return value[index]  
//		boolean isEmpty():判断是否是空字符串:return value.length == 0  
//		String toLowerCase():使用默认语言环境,将 String 中的所有字符转换为小写
//		String toUpperCase():使用默认语言环境,将 String 中的所有字符转换为大写
//		String trim():返回字符串的副本,忽略前导空白和尾部空白
//		boolean equals(Object obj):比较字符串的内容是否相同
//		boolean equalsIgnoreCase(String anotherString):与equals方法类似,忽略大小写
//		String concat(String str):将指定字符串连接到此字符串的结尾。 等价于用“+”  
//		int compareTo(String anotherString):比较两个字符串的大小
//		String substring(int beginIndex):返回一个新的字符串,它是此字符串的从beginIndex开始截取到最后的一个子字符串。  
//		String substring(int beginIndex, int endIndex) :返回一个新字符串,它是此字符串从beginIndex开始截取到endIndex(不包含)的一个子字符串。
		String str = "abcde";
		//提取下标为2的字符
		System.out.println(str.charAt(2));
		System.out.println(str.length());
		System.out.println(str.toUpperCase());
		System.out.println(str.trim());//有点问题
		System.out.println(str.isEmpty());//
		System.out.println("是否相等"+str.equals("abcde"));
		System.out.println("截取字符"+str.substring(2));
		System.out.println("截取某个区间的字符串"+str.substring(2,4));
		System.out.println("*****************************************");
		
		
//		 boolean endsWith(String suffix):测试此字符串是否以指定的后缀结束
//		 boolean startsWith(String prefix):测试此字符串是否以指定的前缀开始
//		 boolean startsWith(String prefix, int toffset):测试此字符串从指定索引开始的子字符串是否以指定前缀开始
//		 boolean contains(CharSequence s):当且仅当此字符串包含指定的 char 值序列时,返回 true,CharSequence 就是字符串,例如:boolean contains = str.contains("cde");
//		 int indexOf(String str):返回指定子字符串在此字符串中第一次出现处的索引
//		 int indexOf(String str, int fromIndex):返回指定子字符串在此字符串中第一次出现处的索引,从指定的索引开始(int fromIndex)
//		 int lastIndexOf(String str):返回指定子字符串在此字符串中最右边出现处的索引
//		 int lastIndexOf(String str, int fromIndex):返回指定子字符串在此字符串中最后一次出现处的索引,从指定的索引开始反向搜索,即从右向左找
//		 注:indexOf和lastIndexOf方法如果未找到都是返回-1

		
		String str1 = "ABACDCE";
		System.out.println(str1.endsWith("E"));
		System.out.println(str1.startsWith("A"));
		System.out.println(str1.startsWith("B",2));//?什么意思
		System.out.println(str1.indexOf("A"));
		System.out.println(str1.indexOf("A",1));//从指定的索引位置开始是什么意思  index是下标的意思
		System.out.println(str1.lastIndexOf("C"));
		System.out.println(str1.lastIndexOf("C",5));//?什么意思
		System.out.println("*************************************");
		
		
//		String replace(char oldChar, char newChar):返回一个新的字符串,它是通过用 newChar 替换此字符串中出现的所有 oldChar 得到的。  
//		String replace(CharSequence target, CharSequence replacement):使用指定的字面值替换序列替换此字符串所有匹配字面值目标序列的子字符串。 
//		String replaceAll(String regex, String replacement) : 使 用 给 定 的replacement 替换此字符串所有匹配给定的正则表达式的子字符串。  
//		String replaceFirst(String regex, String replacement) : 使 用 给 定 的replacement 替换此字符串匹配给定的正则表达式的第一个子字符串。  
//		boolean matches(String regex):告知此字符串是否匹配给定的正则表达式。  
//		String[] split(String regex):根据给定正则表达式的匹配拆分此字符串。  
//		String[] split(String regex, int limit):根据匹配给定的正则表达式来拆分此字符串,最多不超过limit个,如果超过了,剩下的全部都放到最后一个元素中。
		
		String str2 = "QWE12RT12Y";
		System.out.println(str2.replace('Q','9'));	//数字一定要加单引号
		System.out.println(str2.replaceAll("12","0000000"));
		System.out.println(str2.replaceFirst("12","0000000"));
		System.out.println(str2.replaceFirst("\\d","111111"));
		System.out.println(str2.matches("\\w*"));//怎么用
		String tel = "101-12345678";
		int indexOf = tel.indexOf("-");
		String substring = tel.substring(0,indexOf);
		System.out.println(substring);
		
		String [] split= tel.split("-");
		System.out.print(split[0]+"\t");
		System.out.print(split[1]);
	}
}

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值