博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
软件测试第三次作业:Graph Coverage
阅读量:5250 次
发布时间:2019-06-14

本文共 2210 字,大约阅读时间需要 7 分钟。

package homework3;public class prime {	public String printPrimes (int n)     {        int curPrime;         int numPrimes;        boolean isPrime;        int [] primes = new int [10000];        primes [0] = 2;         numPrimes = 1;         curPrime = 2;         while (numPrimes < n)         {             curPrime++;            isPrime = true;            for (int i = 0; i <= numPrimes-1; i++)            {                if (curPrime%primes[i]==0)                {                    isPrime = false;                    break;                }            }            if (isPrime)            {                primes[numPrimes] = curPrime;                numPrimes++;            }        }        String res = "";        for (int i = 0; i <= numPrimes-1; i++)        {            res = res + primes[i] + " ";        }        return res;    }}

(a)

 

(b)

array out of bounds

(c)

n = 1

(d)

NC: {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}

 

EC: {(1,2), (2,3), (3,4), (4,5), (5,6), (6,7), (7,5), (6,8), (5,9), (8,9), (9,2), (9,10), (10,2), (2,11), (11,12), (12,13), (13,14), (14,12), (12,15)}

 

PPC: { (1,2,3,4,5,6,7), (1,2,3,4,5,6,8,9,10),

(1,2,3,4,5,9,10), (1,2,11,12,15),

(1,2,11,12,13,14), (2,3,4,5,6,8,9,2),

(3,4,5,6,8,9,2,3), (4,5,6,8,9,2,3,4),

(5,6,8,9,2,3,4,5), (6,8,9,2,3,4,5,6),

(8,9,2,3,4,5,6,8), (9,2,3,4,5,6,8,9),

(2,3,4,5,6,8,9,10,2), (3,4,5,6,8,9,10,2,3),

(4,5,6,8,9,10,2,3,4), (5,6,8,9,10,2,3,4,5),

(6,8,9,10,2,3,4,5,6), (8,9,10,2,3,4,5,6,8),

(9,10,2,3,4,5,6,8,9), (10,2,3,4,5,6,8,9,10),

(2,3,4,5,9,2), (3,4,5,9,2,3),

(4,5,9,2,3,4), (5,9,2,3,4,5),

(9,2,3,4,5,9), (2,3,4,5,9,10,2),

(3,4,5,9,10,2,3), (4,5,9,10,2,3,4),

(5,9,10,2,3,4,5), (9,10,2,3,4,5,9),

(10,2,3,4,5,9,10), (3,4,5,6,8,9,2,11,12,15),

(3,4,5,6,8,9,2,11,12,13,14), (3,4,5,6,8,9,10,2,11,12,15),

(3,4,5,6,8,9,10,2,11,12,13,14), (3,4,5,9,2,11,12,15),

(3,4,5,9,2,11,12,13,14), (3,4,5,9,10,2,11,12,13,14),

(3,4,5,9,10,2,11,12,15), (5,6,7,5),

(6,7,5,6), (7,5,6,7),

(6,7,5,9,2,11,12,13,14), (6,7,5,9,2,11,12,15),

(6,7,5,9,10,2,11,12,13,14), (6,7,5,9,10,2,11,12,15),

(6,7,5,9,2,3,4), (6,7,5,9,10,2,3,4),

(7,5,6,8,9,2,3,4), (7,5,6,8,9,10,2,3,4),

(12,13,14,12), (13,14,12,13),

(14,12,13,14), (13,14,12,15)

}

转载于:https://www.cnblogs.com/ssseal/p/6530647.html

你可能感兴趣的文章
URAL 1002 Phone Numbers(KMP+最短路orDP)
查看>>
web_day4_css_宽度
查看>>
用sql删除数据库重复的数据的方法
查看>>
学习笔记21—PS换图片背景
查看>>
electron入门心得
查看>>
格而知之2:UIView的autoresizingMask属性探究
查看>>
Spring3.0 AOP 具体解释
查看>>
我的Hook学习笔记
查看>>
EasyUI DataGrid 中字段 formatter 格式化不起作用
查看>>
海量数据存储
查看>>
js中的try/catch
查看>>
[导入]玫瑰丝巾!
查看>>
自动从网站上面下载文件 .NET把网站图片保存到本地
查看>>
【识记】 域名备案
查看>>
STL uva 11991
查看>>
MY SQL的下载和安装
查看>>
自定义OffMeshLink跳跃曲线
查看>>
寄Android开发Gradle你需要知道的知识
查看>>
简述spring中常有的几种advice?
查看>>
学习Redux之分析Redux核心代码分析
查看>>