DECLARE @n INT;
DECLARE @i INT;
DECLARE @flag INT;
SELECT @n = 19;SELECT @i = 2;
SELECT @flag = 0WHILE (@i <= SQRT(@n))BEGIN
IF (@n % @i = 0)
BEGIN
SET @flag = 1
BREAK;
END;
SET @i += 1;END;
IF (@flag=0)
PRINT ('是素数');
ELSE
PRINT ('不是素数');
到了后面,越来越发现C的重要性。