- 博客(6)
- 收藏
- 关注
原创 java学习04
一:循环结构:whilewhile格式 /* while格式 * while(添加表达式){ * 条件表达式成立时执行的代码块 * } * 格式与if完全相同 * */while执行过程int a=1;if(a<5) { System.out.println("if a="+a);}//if :条件表达式成立 执行代码块一次a=1;while(a<5) { System.ou
2021-01-11 17:54:49 408
原创 for小应用“百钱买百鸡”
百钱买百鸡题目描述3文钱可以买1只公鸡;2文钱可以买一只母鸡;1文钱可以买3只小鸡。用100文钱买100只鸡,那么各有公鸡、母鸡、小鸡多少只。 { int x1=0,y1=0,z1=0; for (int x = 0; x <=100/3.0; x++) { for (int y = 0; y <=100/2.0; y++) { for (int z = 0; z <=100; z++) { x1=3*x;//钱数 y
2021-01-09 20:38:39 123 1
原创 9行 实心菱形
for 小实例使用for循环打印一个9行的 实心菱形 { int r=7; int t=0; for(int i=0;i<=5;i++){ for (int j1 = 1; j1 <=5-i; j1++) { System.out.print(" "); } t=2*i-1; for (int j = 0; j < t; j++) { Syste
2021-01-09 20:17:35 406
原创 java学习03
一:运算后结果的数据类型byte short char 不能直接参加运算 需要自动提升为int byte b1=1,b2=1; short s1=1,s2=1; char c1=1,c2=1;// b1=b1+b2;//Type mismatch: cannot convert from int to byte// //byte+byte=int// b1=b1+s1;//byte+short=int// b1=s1+c1;//short+char=in
2021-01-09 12:56:56 72 2
原创 java学习02
一:helloworld扩展1 打印输出语句System.out.println("打印输出语句11");System.out.println("打印输出语句12");System.out.println("打印输出语句13");System.out.print("---1");System.out.print("---2");System.out.print("---3");System.out.println("")有换行功能System.out.print("")无换行功能2 注释
2021-01-09 12:53:30 106
原创 java 学习01
零:前提准备安装软件:内网通 进入班级群java34 点击讲师下载需要的软件安装软件:emc安装软件:markdown安装软件:notepad++安装软件:有道安装软件:pdf阅读器一:markdown的使用"#"表示标题三个“~”+语言java代码"*"列表二:windows最基本的快捷键ctrl+s 保存ctrl+c 赋值ctrl+v 粘贴ctrl+a 全选ctrl+z 撤销三:java概念:一门高级计算机编程语言高级:计算机不能直接运行(计算机只识别字节
2021-01-09 12:50:08 90
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人