质数不可以是负数,在质数的定义中严格要求了质数是大于1的。关于质数(prime number)的定义:Wolfram MathWorld 定义如下( http://mathworld.wolfram.com/PrimeNumber.html):A prime number (or prime integer, often simply called a "prime" for short) is a positive integer p>1 that has no positive integer divisors other than 1 and itself. Wikipedia 定义如下( http://en.wikipedia.org/wiki/Prime_number):In mathematics, a prime number (or a prime) is a natural number which has exactly two distinct natural number divisors: 1 and itself. 维基百科(中文)定义如下( http://zh.wikipedia.org/zh-hans/%E7%B4%A0%E6%95%B0):素数,亦称质数,指在一个大于1的自然数中,除了1和此整数自身外,没法被其他自然数整除的数。换句话说,只有两个正因数(1和自己)的自然数即为素数。Gook Lucd...只有1和它本身这两个因数的自然数叫做质数
这进是定义:既然是自然数,那么就是非负数咯只有1和它本身这两个因数的自然数叫做质数 不能为负数 自然数从0开始 >0