create function maxfactor(@n int) ①______________ int as ②_________ declare @i int,@f int set @f=1 set @i=@n/2 while ③____________ begin if @n%@i=0 begin set @f=@i ④_________ end set ⑤______________ end ⑥___________ @f end
时间: 2023-12-06 12:41:18 浏览: 66
化妆品品牌认识讲义.pptx
create function maxfactor(@n int) returns int as
begin
declare @i int, @f int
set @f=1
set @i=@n/2
while @i>1
begin
if @n%@i=0
begin
set @f=@i
break
end
set @i = @i - 1
end
return @f
end
阅读全文