T-SQL语言编程
发布网友
发布时间:2022-04-08 00:37
我来回答
共1个回答
热心网友
时间:2022-04-08 02:07
4.create proc G4 @power
as
begin
declare @x int
if @power<=50
set @x=2.6*@power
else
set @x=2.6*50+(@power-50)*5.2
print @x
end
5.create proc G5
as
begin
declare @x int
set @x=1
while @x<=500
begin
if @x%3=2 and @x%5=3 and @x%7=2
print @x
set @x=@x+1
end
end
6.create proc G6
as
begin
declare @y int,@z int,@x int,@n int
select @y=1,@n=0
While @y<=9
begin
Set @z=1
while @z<=12
begin
Set @x=1
while @x<=72
begin
if @y*4+@z*3+@x*0.5=36 and @y+@z+@x=36
begin
set @n=@n+1
print '第'+ltrim(str(@n))+'方法:'
print '男人数:'+ltrim(str(@y))
print '女人数:'+ltrim(str(@z))
print '小孩数:'+ltrim(str(@x))
end
set @x=@x+1
end
set @z=@z+1
end
set @y=@y+1
end
end