给你说最后一个
create function f_tableinfo
(
@tableName nvarchar(200)
)
returns @result table (
ColName nvarchar(200),
ColType nvarchar(200),
ColLength int,
ColIsNull bit
)
as
begin
insert into @result(ColName,ColType,ColLength,ColIsNull)
select
c.[name] as ColumnName,
t.[name] as ColumnType,
c.max_length as MaxLength,
c.is_nullable as [IsNull]
from sys.columns c
inner join sys.types t on c.system_type_id=t.system_type_id
where c.[object_id]=object_id(@tableName) and t.[name]<>'sysname'
order by c.column_id
return
end
#include "stdio.h"
void main()
{
int x,y
scanf("%d",&x)
if (x=10) y=3*x+10
else y=2*x-1
printf("%d",y)
}
扩展资料
分段函数x(x<1) 代码
#include <stdio.h>
int main()
{
int x,y
printf("请输入x:")
scanf("%d",&x)
if(x>-5 &&x<0)
y = x
else if(x==0)
y = x-1
else if(x>0 &&x<10)
y = x+1
else
y=100
printf("y=%d\n",y)
return 0
}
这么多数字相乘会溢出的,给你改成加法了,意思一样的
declare @i int
declare @j int
set @i=0
set @j=1
while @j<=50
begin
if(@j%2=1)
set @i=@i+@j
set @j=@j+1
end
print convert(nvarchar(20),@i)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)