2022年7月22日

摘要: 强制类型转换 强制转换就是自动转换的逆转换,当高精度类型到低精度的转换时候需要用(数据类型)变量名来强制转换,由程序员编程决定,编译系统执行,强制类型转换通常都用赋值语句来实现。 注意的是高位转化为低位的时候,数据的范围要在低位范围内,例如不能将一个很大的整数300000转化char型,因为它超过了 阅读全文
posted @ 2022-07-22 18:25 190503 阅读(69) 评论(0) 推荐(0) 编辑

2022年4月16日

摘要: Scanner in=new Scanner(System.in); System.out.println("请输入n的值:"); int n=in.nextInt(); int m=n; int s=1; for(;n>=1;n--){ s=s*n; } System.out.println(m+ 阅读全文
posted @ 2022-04-16 19:21 190503 阅读(244) 评论(0) 推荐(0) 编辑
 
摘要: import java.util.*; public class k37 { public static void main(String[] args){ Scanner in=new Scanner(System.in); System.out.println("\t教师人数统计"); Syst 阅读全文
posted @ 2022-04-16 19:20 190503 阅读(111) 评论(0) 推荐(0) 编辑
 
摘要: import java.util.*;public class k32 { public static void main(String[] args){ Scanner in=new Scanner(System.in); int id=123,pwd=456; System.out.printl 阅读全文
posted @ 2022-04-16 19:18 190503 阅读(65) 评论(0) 推荐(0) 编辑
 
摘要: import java.util.Scanner; public class k29 { public static void main(String[] args){ Scanner in=new Scanner(System.in); System.out.println("\t模拟自动取款机系 阅读全文
posted @ 2022-04-16 19:17 190503 阅读(128) 评论(0) 推荐(0) 编辑
 
摘要: import java.util.*; public class k28 { public static void main(String[] args){ Scanner in=new Scanner(System.in); System.out.println("\t自动售水系统【满20元享9折 阅读全文
posted @ 2022-04-16 19:14 190503 阅读(18) 评论(0) 推荐(0) 编辑
 
摘要: import java.text.SimpleDateFormat;import java.util.Date; public class k27 { public static void main(String[] args){ Date date=new Date(); SimpleDateFo 阅读全文
posted @ 2022-04-16 19:14 190503 阅读(26) 评论(0) 推荐(0) 编辑
 
摘要: import java.util.Scanner; public class k25 { public static void main(String[] args){ Scanner in=new Scanner(System.in); System.out.println("请输入百分之成绩:" 阅读全文
posted @ 2022-04-16 19:13 190503 阅读(86) 评论(0) 推荐(0) 编辑
 
摘要: import java.util.Scanner; public class k21 { public static void main(String[] args){ double price=0.0;//定义可征税的收入 int status=0;//纳税人的情况 double tax=0;// 阅读全文
posted @ 2022-04-16 19:12 190503 阅读(207) 评论(0) 推荐(0) 编辑
 
摘要: import java.util.Scanner; public class k20 { public static void main(String[] args){ Scanner in=new Scanner(System.in); int a,b,c,max,min; System.out. 阅读全文
posted @ 2022-04-16 19:11 190503 阅读(402) 评论(0) 推荐(0) 编辑