int main() { int input = 0; scanf_s("%d",&input); if (input < 2) { printf("wrong input"); return 0; } for (int i = 2; i < input; i++) { if (input % i == 0)//能整除说明不是素数 { printf("not prime");//不是素数就不要循环下去了 return 0; }
DECLARE @number1 AS numeric(10,2),@number2 AS numeric(10,2) SELECT @number1=10.00,@number2=10.2 SELECT CASE WHEN CAST(@number1 AS INT)=@number1 THEN '整数' ELSE '小数' END, CASE WHEN CAST(@number2 AS INT)=@number2 THEN '整数' ELSE '小数' END GOSELECT TOP 100