摘要: package com.company;public class javaDay06_4 { public static void main(String[] args) { //使用数组和函数来求多个数的和 int arr1[] = new int[]{1, 2, 3, 4, 5, 6}; int 阅读全文
posted @ 2018-11-13 17:50 ZRS_009 阅读(160) 评论(0) 推荐(0) 编辑
摘要: package com.company;public class javaDay06_4 { public static void main(String[] args){ //使用数组和函数来求多个数的和 int arr1[]=new int[]{1,2,3,4,5,6}; int sum=add 阅读全文
posted @ 2018-11-13 17:27 ZRS_009 阅读(142) 评论(0) 推荐(0) 编辑
摘要: package com.company;public class javaDay06_3 { public static void main(String[] args){ //数组(一组数据) //数组元素的定义格式1 //元素类型[] 数组名称=new 元素类型[数组的的个数或者长度] //创建 阅读全文
posted @ 2018-11-13 17:14 ZRS_009 阅读(173) 评论(0) 推荐(0) 编辑
摘要: package com.company;public class javaDay06_2 { public static void main(String[] args){ int sum=add(2,3); System.out.println(sum); int sum2=add(2,3,5); 阅读全文
posted @ 2018-11-13 15:44 ZRS_009 阅读(179) 评论(0) 推荐(0) 编辑
摘要: package zrs; public class javaDay06 { public static void main(String[] args) { //代码块一般都不写在主函数当中,主函数当中只是调用 draw(3,5); draw(10,7); draw(-1,-2); System.o 阅读全文
posted @ 2018-11-13 13:47 ZRS_009 阅读(174) 评论(0) 推荐(0) 编辑
摘要: package zrs; public class javaDay05_2 { public static void main(String[] args) { //需求:输出下面的图形 /*54321 *5432 *543 *54 *5 * */ for(int x=1;x<=5;x++) { f 阅读全文
posted @ 2018-11-05 18:37 ZRS_009 阅读(142) 评论(0) 推荐(0) 编辑
摘要: package zrs; public class javaDay05 { public static void main(String[] args) { //需求: 得到数值,输出对应的季节 int x=0; if(x==3 || x==4 || x==5) { System.out.print 阅读全文
posted @ 2018-11-05 18:04 ZRS_009 阅读(142) 评论(0) 推荐(0) 编辑
摘要: package zrs; public class javaDay04 { public static void main(String[] args) { //break 语句 和continue语句 for(int x=0;x<3;x++) { if(x==2) { break;//break语 阅读全文
posted @ 2018-11-04 12:54 ZRS_009 阅读(152) 评论(0) 推荐(0) 编辑
摘要: package zrs; public class javaDay03_3 { public static void main(String[] args) { //循环的嵌套 for(int x=0;x<3;x++) {//外循环控制行 for(int y=0;y<4;y++) { //内循环控制 阅读全文
posted @ 2018-11-01 15:31 ZRS_009 阅读(206) 评论(0) 推荐(1) 编辑
摘要: package zrs; public class javaDay03_2 { public static void main(String[] args) { //for循环 int sum=0; for(int x=1;x<=10;x++) { sum=sum+x; } System.out.p 阅读全文
posted @ 2018-11-01 14:14 ZRS_009 阅读(168) 评论(0) 推荐(0) 编辑