懒羊羊softwaretesting

导航

2018年3月18日 #

1000以内的完数个数

摘要: public class WanshuDemo { //如果一个数正好等于它的因子之和,那么这个数就叫完数 public static void main(String[] args) { // 定义因子之和 System.out.println("1000以内的完数有:"); for (int i 阅读全文

posted @ 2018-03-18 12:14 懒羊羊呐 阅读(478) 评论(0) 推荐(0) 编辑

求100以内的质数的个数

摘要: public class Zhishu { public static void main(String[] args) { // 求100以内的质数个数 int count = 0;// 记录个数 boolean flag = true; for (int i = 2; i <= 100; i++ 阅读全文

posted @ 2018-03-18 10:54 懒羊羊呐 阅读(262) 评论(0) 推荐(0) 编辑

用Java给数组排序

摘要: public class BubbleDemo {public static void main(String[] args) { int arr[]={1,3,5,7,2,4,6,8,9}; bubble(arr);} public static void bubble(int arr[]){ f 阅读全文

posted @ 2018-03-18 10:40 懒羊羊呐 阅读(270) 评论(0) 推荐(0) 编辑