?? 福彩22選5縮水算法.txt
字號(hào):
福彩22選5縮水算法
/**************************************
* 軟件名稱: 福彩22選5縮水軟件
* 開(kāi) 發(fā) 者: tohen
* 開(kāi)發(fā)日期: 2007-05-10
* 備 注:
1.其算法適合所有的樂(lè)透型彩票
2.縮水條件可拓展
***************************************/
/* 創(chuàng)建基本表
create table T1(R1 varchar(10))
create table T2(R2 varchar(10))
create table T3(R3 varchar(10))
create table T4(R4 varchar(10))
create table T5(R5 varchar(10))
delete from T1
delete from T2
delete from T3
delete from T4
delete from T5
*/
/*** 組合數(shù)據(jù) ***/
--R1
declare @i int
set @i=1
A:
begin
insert into T1 select right('0'+Cast(@i as varchar(10)),2)
end
set @i=@i+1
if @i <=18 goto A
select * from T1
GO
--R2
declare @i int
set @i=2
A:
begin
insert into T2 select right('0'+Cast(@i as varchar(10)),2)
end
set @i=@i+1
if @i <=19 goto A
select * from T2
GO
--R3
declare @i int
set @i=3
A:
begin
insert into T3 select right('0'+Cast(@i as varchar(10)),2)
end
set @i=@i+1
if @i <=20 goto A
select * from T3
GO
--R4
declare @i int
set @i=4
A:
begin
insert into T4 select right('0'+Cast(@i as varchar(10)),2)
end
set @i=@i+1
if @i <=21 goto A
select * from T4
GO
--R5
declare @i int
set @i=5
A:
begin
insert into T5 select right('0'+Cast(@i as varchar(10)),2)
end
set @i=@i+1
if @i <=22 goto A
select * from T5
GO
/*** 整合表(全部組合) ***/
select * into T from T1,T2,T3,T4,T5
where
R1<R2 and R1<R3 and R1<R4 and R1<R5 and
R2<R3 and R2<R4 and R2<R5 and
R3<R4 and R3<R5 and R4<R5
/*** 縮水 ***/
select * from T where
--首號(hào): [02,X)
R1>='02'
--尾號(hào): (X,20]
and R5<='20'
--奇數(shù): 2個(gè)
and (R1%2 + R2%2 + R3%2 + R4%2 + R5%2)=2
--和值: 40
and (Cast(R1 as int) + Cast(R2 as int) + Cast(R3 as int) + Cast(R4 as int) + Cast(R5 as int))=40
--連號(hào): 2個(gè)
and (Case Cast(R2 as int)-Cast(R1 as int) when 1 then 1 else 0 end)+
(Case Cast(R3 as int)-Cast(R2 as int) when 1 then 1 else 0 end)+
(Case Cast(R4 as int)-Cast(R3 as int) when 1 then 1 else 0 end)+
(Case Cast(R5 as int)-Cast(R4 as int) when 1 then 1 else 0 end) = 2
--跨度: 10
and Cast(R5 as int)-Cast(R1 as int)=10
--重號(hào): 2個(gè) (假設(shè)上期開(kāi)獎(jiǎng)號(hào)為:01,02,03,04,05)
and (Case when R1 in ('01','02','03','04','05') then 1 else 0 end)+
(Case when R2 in ('01','02','03','04','05') then 1 else 0 end)+
(Case when R3 in ('01','02','03','04','05') then 1 else 0 end)+
(Case when R4 in ('01','02','03','04','05') then 1 else 0 end)+
(Case when R5 in ('01','02','03','04','05') then 1 else 0 end)=2
--AC值: 9
and (select count(*) from
(select right('0'+Cast(Cast(R5 as int)-Cast(R4 as int) as varchar(10)),2) as a union
select right('0'+Cast(Cast(R5 as int)-Cast(R3 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R5 as int)-Cast(R2 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R5 as int)-Cast(R1 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R4 as int)-Cast(R3 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R4 as int)-Cast(R2 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R4 as int)-Cast(R1 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R3 as int)-Cast(R2 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R3 as int)-Cast(R1 as int) as varchar(10)),2) union
select right('0'+Cast(Cast(R2 as int)-Cast(R1 as int) as varchar(10)),2)) A) = 9
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -