可能重复:
在java中重复String的简单方法
如何将数字转换为符号?我的任务的最后一部分是这样的:直方图应根据该值的滚动次数显示2-12的条形图.如下所示:
目前我的输出是这样的:
public static void main(String[] args) {
// TODO code application logic here
System.out.print("Please enter how many times you want to roll two dice?");
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int [] rolls = new int[n];
Random r1 = new Random();
Random r2 = new Random();
int dice1;
int dice2;
int two = 0;
int three = 0;
int four = 0;
int five = 0;
int six = 0;
int seven = 0; …Run Code Online (Sandbox Code Playgroud)