java随机生成20个1—100之间的整数 组成10个加法算式

jiaojian829 1年前 已收到1个回答 举报

lxsqsct 花朵

共回答了18个问题采纳率:88.9% 举报

public class Test {
public static void main(String sgs[]) {
for(int i = 0; i < 10; i++){
int x = (int) (Math.random() * 100 + 1);
int y = (int) (Math.random() * 100 + 1);
System.out.println(x + " + " + y + " = " + (x + y));
}
}
}

1年前

1
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 17 q. 0.030 s. - webmaster@yulucn.com