首页 > 其他 > 详细

简单的四则运算

时间:2015-03-28 11:28:57      阅读:235      评论:0      收藏:0      [点我收藏+]

import java.util.Random;
public class SiZe {

/**
* @param args
*/
public static void main(String[] args) {

String[] str_1 = new String[] {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
String[] str_2 = new String[] { "+", "-", "*", "/", "+", "-", "*", "/", "+", "-", "*", "/" };
int index = 0;
for(int i = 0; i < 4; i++)
{
int j = 0;
int index_1 = new Random().nextInt(9);
System.out.print(str_1[index_1]);
if(i != 3)
{
int index_2 = new Random().nextInt(12);
System.out.print(str_2[index_2]);
}
}

}

}

简单的四则运算

原文:http://www.cnblogs.com/OuZeBo/p/4373873.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!