java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-21
来源:互联网 发布:微信怎么分享淘宝店铺 编辑:程序博客网 时间:2024/05/02 05:09
package chapter7;public class T21 {public static void main(String[] args) {int boll = 5;int slot = 8;int[] b = new int[boll];for(int i=0;i<boll;i++){b[i]=1;for(int j=0;j<slot;j++){int random = r();b[i]+=random;if(random==0)System.out.print("L");elseSystem.out.print("R");}System.out.println();}System.out.println();for(int e:b){System.out.print(e+" ");}System.out.println();for(int i=0;i<boll;i++){for(int j=0;j<b[i];j++)System.out.print(" ");System.out.println("0");}}public static int r(){return (int)(Math.random()*2);}}
0 0
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-21
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-23
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-24
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-30
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-31
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-32
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-33
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter6-27
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter6-28
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter6-29
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter6-30
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter6-31
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter6-32
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter12-11
- java语言程序设计第十版(Introduce to java) 课后习题 chapter6-10
- java语言程序设计第十版(Introduce to java) 课后习题 chapter6-6
- java语言程序设计第十版(Introduce to java) 课后习题 chapter6-13
- java语言程序设计第十版(Introduce to java) 课后习题 chapter6-14
- 在Dell XPS 13安装WIN10和ubuntu双系统
- 小白笔记---------------------自然合并排序算法(感谢bob的指导)
- 能咋地
- spring学习笔记(19)mysql读写分离后端AOP控制实例
- 多线程
- java语言程序设计第十版(Introduce to java 10th) 课后习题 chapter7-21
- Qtablewiget 清空表格内容;
- Python-pip 安装失败问题解决
- unity移植到Xcode ld: library not found for -liPhone-lib
- 圆角图标的显示优化
- html细节上的错误
- Android中Fragment和Activity之间的通信(含接口回调)
- ubuntu设置SSH安全登录
- Java关于父类引用指向子类对象