楼主: newkid

[精华] 深夜独霸, 轮到我出个题目了——算24点的SQL解法

[复制链接]
论坛徽章:
12
八级虎吧徽章
日期:2008-12-28 16:00:482013年新春福章
日期:2013-02-25 14:51:242010年世界杯参赛球队:德国
日期:2010-07-05 17:34:42冬季摄影比赛纪念奖
日期:2009-03-18 09:08:21九尾狐狸
日期:2009-03-16 10:19:16生肖徽章2007版:猴
日期:2009-03-10 21:35:50生肖徽章2007版:猪
日期:2009-03-10 21:31:23生肖徽章2007版:兔
日期:2009-03-10 21:20:36生肖徽章2007版:鸡
日期:2009-03-10 21:16:44生肖徽章2007版:兔
日期:2008-12-29 20:32:58
121#
发表于 2009-1-5 17:40 | 只看该作者
搬个板凳占个位学习...

使用道具 举报

回复
论坛徽章:
7
生肖徽章:猪
日期:2007-09-26 17:09:50ITPUB元老
日期:2010-04-29 22:07:05
122#
发表于 2009-1-6 13:13 | 只看该作者
学习,牛人啊!!

使用道具 举报

回复
论坛徽章:
211
国际米兰
日期:2010-01-11 10:26:28ITPUB评论家
日期:2007-11-04 01:35:51季节之章:春
日期:2011-04-03 16:30:30热刺
日期:2009-09-21 10:54:48天枰座
日期:2015-11-05 16:32:03月度论坛发贴之星
日期:2010-05-01 02:15:42生肖徽章:狗
日期:2006-10-01 00:29:23BLOG每周发帖之星
日期:2009-08-30 01:35:31BLOG每日发帖之星
日期:2009-08-28 01:01:02妮可·罗宾
日期:2016-10-19 10:45:04
123#
发表于 2009-1-6 23:27 | 只看该作者
强悍

使用道具 举报

回复
论坛徽章:
0
124#
发表于 2009-1-14 10:51 | 只看该作者
没有看明白啊。

使用道具 举报

回复
论坛徽章:
0
125#
发表于 2009-1-15 09:52 | 只看该作者
期待牛人  的答案

使用道具 举报

回复
论坛徽章:
1
2010新春纪念徽章
日期:2010-03-01 11:20:05
126#
发表于 2009-1-15 11:31 | 只看该作者
呵呵
难度很高
等待学习。。。

使用道具 举报

回复
论坛徽章:
1
2010新春纪念徽章
日期:2010-03-01 11:19:10
127#
发表于 2009-1-16 14:02 | 只看该作者
高桿

使用道具 举报

回复
论坛徽章:
7
参与SAP云计算之旅活动纪念
日期:2011-05-23 11:02:23ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282014年新春福章
日期:2014-02-18 16:41:11马上有车
日期:2014-02-18 16:41:11喜羊羊
日期:2015-02-11 12:25:49美羊羊
日期:2015-03-04 14:48:582015年新春福章
日期:2015-03-06 11:57:31
128#
发表于 2009-2-7 21:31 | 只看该作者
N REN

使用道具 举报

回复
论坛徽章:
41
秀才
日期:2015-07-30 11:13:40秀才
日期:2015-09-06 10:42:32秀才
日期:2015-09-10 09:29:01处女座
日期:2016-05-27 11:00:18
129#
发表于 2009-2-12 16:49 | 只看该作者
不会/看看/

使用道具 举报

回复
论坛徽章:
548
生肖徽章2007版:猴
日期:2008-05-16 11:28:59生肖徽章2007版:马
日期:2008-10-08 17:01:01SQL大赛参与纪念
日期:2011-04-13 12:08:17授权会员
日期:2011-06-17 16:14:53ITPUB元老
日期:2011-06-21 11:47:01ITPUB官方微博粉丝徽章
日期:2011-07-01 09:45:27ITPUB十周年纪念徽章
日期:2011-09-27 16:30:472012新春纪念徽章
日期:2012-01-04 11:51:222012新春纪念徽章
日期:2020-11-30 22:13:24海蓝宝石
日期:2012-02-20 19:24:27
130#
发表于 2011-5-13 11:14 | 只看该作者
--不考虑去重, 我的PLSQL方法:

create or replace procedure proc24(p_num1 in pls_integer,
                                   p_num2 in pls_integer,
                                   p_num3 in pls_integer,
                                   p_num4 in pls_integer) is
  cursor cur is
    with table_operator as
     (select decode(substr(op_str, instr(op_str, '/', 1, 1) + 1, 1),
                    1,
                    '+',
                    2,
                    '-',
                    3,
                    '*',
                    4,
                    '/') op_1,
             decode(substr(op_str, instr(op_str, '/', 1, 2) + 1, 1),
                    1,
                    '+',
                    2,
                    '-',
                    3,
                    '*',
                    4,
                    '/') op_2,
             decode(substr(op_str, instr(op_str, '/', 1, 3) + 1, 1),
                    1,
                    '+',
                    2,
                    '-',
                    3,
                    '*',
                    4,
                    '/') op_3
        from (select sys_connect_by_path(rn, '/') op_str
                from (select rownum rn from dual connect by level <= 4)
               where level = 3
              connect by level <= 4)),
    table_number as
     (select decode(substr(num, instr(num, '/', 1, 1) + 1, 1),
                    1,
                    p_num1,
                    2,
                    p_num2,
                    3,
                    p_num3,
                    4,
                    p_num4) num_1,
             decode(substr(num, instr(num, '/', 1, 2) + 1, 1),
                    1,
                    p_num1,
                    2,
                    p_num2,
                    3,
                    p_num3,
                    4,
                    p_num4) num_2,
             decode(substr(num, instr(num, '/', 1, 3) + 1, 1),
                    1,
                    p_num1,
                    2,
                    p_num2,
                    3,
                    p_num3,
                    4,
                    p_num4) num_3,
             decode(substr(num, instr(num, '/', 1, 4) + 1, 1),
                    1,
                    p_num1,
                    2,
                    p_num2,
                    3,
                    p_num3,
                    4,
                    p_num4) num_4
        from (select sys_connect_by_path(rn, '/') num
                from (select rownum rn from dual connect by level <= 4)
               where level = 4
              connect by nocycle rn <> prior rn)),
    table_parenthesis as
     (select 0 locat
        from dual
      union all
      select 12 locat
        from dual
      union all
      select 13 locat
        from dual
      union all
      select 23 locat
        from dual
      union all
      select 24 locat
        from dual
      union all
      select 34 locat
        from dual
      union all
      select 1213 locat
        from dual
      union all
      select 1234 locat
        from dual
      union all
      select 1323 locat
        from dual
      union all
      select 2324 locat
        from dual
      union all
      select 2434 locat from dual)
    select num_1, op_1, num_2, op_2, num_3, op_3, num_4, locat
      from table_operator, table_number, table_parenthesis;

  v_express varchar2(100) := null;
  v_result  number := 0;

  v_num_1 varchar(10) := null;
  v_num_2 varchar(10) := null;
  v_num_3 varchar(10) := null;
  v_num_4 varchar(10) := null;

begin

  for rec in cur loop
  
    v_num_1 := null;
    v_num_2 := null;
    v_num_3 := null;
    v_num_4 := null;
  
    v_express := null;
    v_result  := 0;
  
    if length(rec.locat) = 1 then
   
      v_express := rec.num_1 || rec.op_1 || rec.num_2 || rec.op_2 ||
                   rec.num_3 || rec.op_3 || rec.num_4;
   
    elsif length(rec.locat) = 2 then
   
      case
        when to_number(substr(rec.locat, 1, 1)) = 1 then
          v_num_1 := '(' || rec.num_1;
        when to_number(substr(rec.locat, 1, 1)) = 2 then
          v_num_2 := '(' || rec.num_2;
        when to_number(substr(rec.locat, 1, 1)) = 3 then
          v_num_3 := '(' || rec.num_3;
      end case;
   
      case
        when to_number(substr(rec.locat, 2, 1)) = 2 then
          v_num_2 := nvl(v_num_2, rec.num_2) || ')';
        when to_number(substr(rec.locat, 2, 1)) = 3 then
          v_num_3 := nvl(v_num_3, rec.num_3) || ')';
        when to_number(substr(rec.locat, 2, 1)) = 4 then
          v_num_4 := rec.num_4 || ')';
      end case;
   
      v_express := nvl(v_num_1, rec.num_1) || rec.op_1 ||
                   nvl(v_num_2, rec.num_2) || rec.op_2 ||
                   nvl(v_num_3, rec.num_3) || rec.op_3 ||
                   nvl(v_num_4, rec.num_4);
   
    elsif length(rec.locat) = 4 then
   
      case
        when to_number(substr(rec.locat, 1, 1)) = 1 then
          v_num_1 := '(' || rec.num_1;
        when to_number(substr(rec.locat, 1, 1)) = 2 then
          v_num_2 := '(' || rec.num_2;
        when to_number(substr(rec.locat, 1, 1)) = 3 then
          v_num_3 := '(' || rec.num_3;
      end case;
   
      case
        when to_number(substr(rec.locat, 3, 1)) = 1 then
          v_num_1 := '(' || nvl(v_num_1, rec.num_1);
        when to_number(substr(rec.locat, 3, 1)) = 2 then
          v_num_2 := '(' || nvl(v_num_2, rec.num_2);
        when to_number(substr(rec.locat, 3, 1)) = 3 then
          v_num_3 := '(' || nvl(v_num_3, rec.num_3);
      end case;
   
      case
        when to_number(substr(rec.locat, 2, 1)) = 2 then
          v_num_2 := nvl(v_num_2, rec.num_2) || ')';
        when to_number(substr(rec.locat, 2, 1)) = 3 then
          v_num_3 := nvl(v_num_3, rec.num_3) || ')';
        when to_number(substr(rec.locat, 2, 1)) = 4 then
          v_num_4 := nvl(v_num_4, rec.num_4) || ')';
      end case;
   
      case
        when to_number(substr(rec.locat, 4, 1)) = 2 then
          v_num_2 := nvl(v_num_2, rec.num_2) || ')';
        when to_number(substr(rec.locat, 4, 1)) = 3 then
          v_num_3 := nvl(v_num_3, rec.num_3) || ')';
        when to_number(substr(rec.locat, 4, 1)) = 4 then
          v_num_4 := nvl(v_num_4, rec.num_4) || ')';
      end case;
   
      v_express := nvl(v_num_1, rec.num_1) || rec.op_1 ||
                   nvl(v_num_2, rec.num_2) || rec.op_2 ||
                   nvl(v_num_3, rec.num_3) || rec.op_3 ||
                   nvl(v_num_4, rec.num_4);
   
    end if;
  
    begin
      execute immediate 'select ' || v_express || ' from dual'
        into v_result;
    exception
      when zero_divide then
        v_result := 0;
    end;
  
    if v_result = 24 then
      dbms_output.put_line(v_express || '=24');
    end if;
  
  end loop;

end;


SQL> exec proc24(1,2,3,4);

(1+2+3)*4=24
((1+2)+3)*4=24
(1+(2+3))*4=24
(1+3+2)*4=24
((1+3)+2)*4=24
(1+(3+2))*4=24
(2+1+3)*4=24
((2+1)+3)*4=24
(2+(1+3))*4=24
(2+3+1)*4=24
((2+3)+1)*4=24
(2+(3+1))*4=24
(3+1+2)*4=24
((3+1)+2)*4=24
(3+(1+2))*4=24
(3+2+1)*4=24
((3+2)+1)*4=24
(3+(2+1))*4=24
(1+3)*(2+4)=24
(1+3)*(4+2)=24
(2+4)*(1+3)=24
(2+4)*(3+1)=24
(3+1)*(2+4)=24
(3+1)*(4+2)=24
(4+2)*(1+3)=24
(4+2)*(3+1)=24
4*(1+2+3)=24
4*((1+2)+3)=24
4*(1+(2+3))=24
4*(1+3+2)=24
4*((1+3)+2)=24
4*(1+(3+2))=24
4*(2+1+3)=24
4*((2+1)+3)=24
4*(2+(1+3))=24
4*(2+3+1)=24
4*((2+3)+1)=24
4*(2+(3+1))=24
4*(3+1+2)=24
4*((3+1)+2)=24
4*(3+(1+2))=24
4*(3+2+1)=24
4*((3+2)+1)=24
4*(3+(2+1))=24
1*2*3*4=24
(1*2)*3*4=24
(1*2*3)*4=24
1*(2*3)*4=24
1*(2*3*4)=24
1*2*(3*4)=24
((1*2)*3)*4=24
(1*2)*(3*4)=24
(1*(2*3))*4=24
1*((2*3)*4)=24
1*(2*(3*4))=24
1*2*4*3=24
(1*2)*4*3=24
(1*2*4)*3=24
1*(2*4)*3=24
1*(2*4*3)=24
1*2*(4*3)=24
((1*2)*4)*3=24
(1*2)*(4*3)=24
(1*(2*4))*3=24
1*((2*4)*3)=24
1*(2*(4*3))=24
1*3*2*4=24
(1*3)*2*4=24
(1*3*2)*4=24
1*(3*2)*4=24
1*(3*2*4)=24
1*3*(2*4)=24
((1*3)*2)*4=24
(1*3)*(2*4)=24
(1*(3*2))*4=24
1*((3*2)*4)=24
1*(3*(2*4))=24
1*3*4*2=24
(1*3)*4*2=24
(1*3*4)*2=24
1*(3*4)*2=24
1*(3*4*2)=24
1*3*(4*2)=24
((1*3)*4)*2=24
(1*3)*(4*2)=24
(1*(3*4))*2=24
1*((3*4)*2)=24
1*(3*(4*2))=24
1*4*2*3=24
(1*4)*2*3=24
(1*4*2)*3=24
1*(4*2)*3=24
1*(4*2*3)=24
1*4*(2*3)=24
((1*4)*2)*3=24
(1*4)*(2*3)=24
(1*(4*2))*3=24
1*((4*2)*3)=24
1*(4*(2*3))=24
1*4*3*2=24
(1*4)*3*2=24
(1*4*3)*2=24
1*(4*3)*2=24
1*(4*3*2)=24
1*4*(3*2)=24
((1*4)*3)*2=24
(1*4)*(3*2)=24
(1*(4*3))*2=24
1*((4*3)*2)=24
1*(4*(3*2))=24
2*1*3*4=24
(2*1)*3*4=24
(2*1*3)*4=24
2*(1*3)*4=24
2*(1*3*4)=24
2*1*(3*4)=24
((2*1)*3)*4=24
(2*1)*(3*4)=24
(2*(1*3))*4=24
2*((1*3)*4)=24
2*(1*(3*4))=24
2*1*4*3=24
(2*1)*4*3=24
(2*1*4)*3=24
2*(1*4)*3=24
2*(1*4*3)=24
2*1*(4*3)=24
((2*1)*4)*3=24
(2*1)*(4*3)=24
(2*(1*4))*3=24
2*((1*4)*3)=24
2*(1*(4*3))=24
2*3*1*4=24
(2*3)*1*4=24
(2*3*1)*4=24
2*(3*1)*4=24
2*(3*1*4)=24
2*3*(1*4)=24
((2*3)*1)*4=24
(2*3)*(1*4)=24
(2*(3*1))*4=24
2*((3*1)*4)=24
2*(3*(1*4))=24
2*3*4*1=24
(2*3)*4*1=24
(2*3*4)*1=24
2*(3*4)*1=24
2*(3*4*1)=24
2*3*(4*1)=24
((2*3)*4)*1=24
(2*3)*(4*1)=24
(2*(3*4))*1=24
2*((3*4)*1)=24
2*(3*(4*1))=24
2*4*1*3=24
(2*4)*1*3=24
(2*4*1)*3=24
2*(4*1)*3=24
2*(4*1*3)=24
2*4*(1*3)=24
((2*4)*1)*3=24
(2*4)*(1*3)=24
(2*(4*1))*3=24
2*((4*1)*3)=24
2*(4*(1*3))=24
2*4*3*1=24
(2*4)*3*1=24
(2*4*3)*1=24
2*(4*3)*1=24
2*(4*3*1)=24
2*4*(3*1)=24
((2*4)*3)*1=24
(2*4)*(3*1)=24
(2*(4*3))*1=24
2*((4*3)*1)=24
2*(4*(3*1))=24
3*1*2*4=24
(3*1)*2*4=24
(3*1*2)*4=24
3*(1*2)*4=24
3*(1*2*4)=24
3*1*(2*4)=24
((3*1)*2)*4=24
(3*1)*(2*4)=24
(3*(1*2))*4=24
3*((1*2)*4)=24
3*(1*(2*4))=24
3*1*4*2=24
(3*1)*4*2=24
(3*1*4)*2=24
3*(1*4)*2=24
3*(1*4*2)=24
3*1*(4*2)=24
((3*1)*4)*2=24
(3*1)*(4*2)=24
(3*(1*4))*2=24
3*((1*4)*2)=24
3*(1*(4*2))=24
3*2*1*4=24
(3*2)*1*4=24
(3*2*1)*4=24
3*(2*1)*4=24
3*(2*1*4)=24
3*2*(1*4)=24
((3*2)*1)*4=24
(3*2)*(1*4)=24
(3*(2*1))*4=24
3*((2*1)*4)=24
3*(2*(1*4))=24
3*2*4*1=24
(3*2)*4*1=24
(3*2*4)*1=24
3*(2*4)*1=24
3*(2*4*1)=24
3*2*(4*1)=24
((3*2)*4)*1=24
(3*2)*(4*1)=24
(3*(2*4))*1=24
3*((2*4)*1)=24
3*(2*(4*1))=24
3*4*1*2=24
(3*4)*1*2=24
(3*4*1)*2=24
3*(4*1)*2=24
3*(4*1*2)=24
3*4*(1*2)=24
((3*4)*1)*2=24
(3*4)*(1*2)=24
(3*(4*1))*2=24
3*((4*1)*2)=24
3*(4*(1*2))=24
3*4*2*1=24
(3*4)*2*1=24
(3*4*2)*1=24
3*(4*2)*1=24
3*(4*2*1)=24
3*4*(2*1)=24
((3*4)*2)*1=24
(3*4)*(2*1)=24
(3*(4*2))*1=24
3*((4*2)*1)=24
3*(4*(2*1))=24
4*1*2*3=24
(4*1)*2*3=24
(4*1*2)*3=24
4*(1*2)*3=24
4*(1*2*3)=24
4*1*(2*3)=24
((4*1)*2)*3=24
(4*1)*(2*3)=24
(4*(1*2))*3=24
4*((1*2)*3)=24
4*(1*(2*3))=24
4*1*3*2=24
(4*1)*3*2=24
(4*1*3)*2=24
4*(1*3)*2=24
4*(1*3*2)=24
4*1*(3*2)=24
((4*1)*3)*2=24
(4*1)*(3*2)=24
(4*(1*3))*2=24
4*((1*3)*2)=24
4*(1*(3*2))=24
4*2*1*3=24
(4*2)*1*3=24
(4*2*1)*3=24
4*(2*1)*3=24
4*(2*1*3)=24
4*2*(1*3)=24
((4*2)*1)*3=24
(4*2)*(1*3)=24
(4*(2*1))*3=24
4*((2*1)*3)=24
4*(2*(1*3))=24
4*2*3*1=24
(4*2)*3*1=24
(4*2*3)*1=24
4*(2*3)*1=24
4*(2*3*1)=24
4*2*(3*1)=24
((4*2)*3)*1=24
(4*2)*(3*1)=24
(4*(2*3))*1=24
4*((2*3)*1)=24
4*(2*(3*1))=24
4*3*1*2=24
(4*3)*1*2=24
(4*3*1)*2=24
4*(3*1)*2=24
4*(3*1*2)=24
4*3*(1*2)=24
((4*3)*1)*2=24
(4*3)*(1*2)=24
(4*(3*1))*2=24
4*((3*1)*2)=24
4*(3*(1*2))=24
4*3*2*1=24
(4*3)*2*1=24
(4*3*2)*1=24
4*(3*2)*1=24
4*(3*2*1)=24
4*3*(2*1)=24
((4*3)*2)*1=24
(4*3)*(2*1)=24
(4*(3*2))*1=24
4*((3*2)*1)=24
4*(3*(2*1))=24
2*3*4/1=24
(2*3)*4/1=24
(2*3*4)/1=24
2*(3*4)/1=24
2*(3*4/1)=24
2*3*(4/1)=24
((2*3)*4)/1=24
(2*3)*(4/1)=24
(2*(3*4))/1=24
2*((3*4)/1)=24
2*(3*(4/1))=24
2*4*3/1=24
(2*4)*3/1=24
(2*4*3)/1=24
2*(4*3)/1=24
2*(4*3/1)=24
2*4*(3/1)=24
((2*4)*3)/1=24
(2*4)*(3/1)=24
(2*(4*3))/1=24
2*((4*3)/1)=24
2*(4*(3/1))=24
3*2*4/1=24
(3*2)*4/1=24
(3*2*4)/1=24
3*(2*4)/1=24
3*(2*4/1)=24
3*2*(4/1)=24
((3*2)*4)/1=24
(3*2)*(4/1)=24
(3*(2*4))/1=24
3*((2*4)/1)=24
3*(2*(4/1))=24
3*4*2/1=24
(3*4)*2/1=24
(3*4*2)/1=24
3*(4*2)/1=24
3*(4*2/1)=24
3*4*(2/1)=24
((3*4)*2)/1=24
(3*4)*(2/1)=24
(3*(4*2))/1=24
3*((4*2)/1)=24
3*(4*(2/1))=24
4*2*3/1=24
(4*2)*3/1=24
(4*2*3)/1=24
4*(2*3)/1=24
4*(2*3/1)=24
4*2*(3/1)=24
((4*2)*3)/1=24
(4*2)*(3/1)=24
(4*(2*3))/1=24
4*((2*3)/1)=24
4*(2*(3/1))=24
4*3*2/1=24
(4*3)*2/1=24
(4*3*2)/1=24
4*(3*2)/1=24
4*(3*2/1)=24
4*3*(2/1)=24
((4*3)*2)/1=24
(4*3)*(2/1)=24
(4*(3*2))/1=24
4*((3*2)/1)=24
4*(3*(2/1))=24
2*3/1*4=24
(2*3)/1*4=24
(2*3/1)*4=24
2*(3/1)*4=24
2*(3/1*4)=24
((2*3)/1)*4=24
(2*(3/1))*4=24
2*((3/1)*4)=24
2*4/1*3=24
(2*4)/1*3=24
(2*4/1)*3=24
2*(4/1)*3=24
2*(4/1*3)=24
((2*4)/1)*3=24
(2*(4/1))*3=24
2*((4/1)*3)=24
3*2/1*4=24
(3*2)/1*4=24
(3*2/1)*4=24
3*(2/1)*4=24
3*(2/1*4)=24
((3*2)/1)*4=24
(3*(2/1))*4=24
3*((2/1)*4)=24
3*4/1*2=24
(3*4)/1*2=24
(3*4/1)*2=24
3*(4/1)*2=24
3*(4/1*2)=24
((3*4)/1)*2=24
(3*(4/1))*2=24
3*((4/1)*2)=24
4*2/1*3=24
(4*2)/1*3=24
(4*2/1)*3=24
4*(2/1)*3=24
4*(2/1*3)=24
((4*2)/1)*3=24
(4*(2/1))*3=24
4*((2/1)*3)=24
4*3/1*2=24
(4*3)/1*2=24
(4*3/1)*2=24
4*(3/1)*2=24
4*(3/1*2)=24
((4*3)/1)*2=24
(4*(3/1))*2=24
4*((3/1)*2)=24
2*3/(1/4)=24
(2*3)/(1/4)=24
2*(3/(1/4))=24
2*4/(1/3)=24
(2*4)/(1/3)=24
2*(4/(1/3))=24
3*2/(1/4)=24
(3*2)/(1/4)=24
3*(2/(1/4))=24
3*4/(1/2)=24
(3*4)/(1/2)=24
3*(4/(1/2))=24
4*2/(1/3)=24
(4*2)/(1/3)=24
4*(2/(1/3))=24
4*3/(1/2)=24
(4*3)/(1/2)=24
4*(3/(1/2))=24
2/1*3*4=24
(2/1)*3*4=24
(2/1*3)*4=24
2/1*(3*4)=24
((2/1)*3)*4=24
(2/1)*(3*4)=24
2/1*4*3=24
(2/1)*4*3=24
(2/1*4)*3=24
2/1*(4*3)=24
((2/1)*4)*3=24
(2/1)*(4*3)=24
3/1*2*4=24
(3/1)*2*4=24
(3/1*2)*4=24
3/1*(2*4)=24
((3/1)*2)*4=24
(3/1)*(2*4)=24
3/1*4*2=24
(3/1)*4*2=24
(3/1*4)*2=24
3/1*(4*2)=24
((3/1)*4)*2=24
(3/1)*(4*2)=24
4/1*2*3=24
(4/1)*2*3=24
(4/1*2)*3=24
4/1*(2*3)=24
((4/1)*2)*3=24
(4/1)*(2*3)=24
4/1*3*2=24
(4/1)*3*2=24
(4/1*3)*2=24
4/1*(3*2)=24
((4/1)*3)*2=24
(4/1)*(3*2)=24
2/(1/3)*4=24
(2/(1/3))*4=24
2/(1/4)*3=24
(2/(1/4))*3=24
3/(1/2)*4=24
(3/(1/2))*4=24
3/(1/(2*4))=24
3/(1/4)*2=24
(3/(1/4))*2=24
3/(1/(4*2))=24
4/(1/2)*3=24
(4/(1/2))*3=24
4/(1/(2*3))=24
4/(1/3)*2=24
(4/(1/3))*2=24
4/(1/(3*2))=24
3/(1/2/4)=24
3/((1/2)/4)=24
3/(1/4/2)=24
3/((1/4)/2)=24
4/(1/2/3)=24
4/((1/2)/3)=24
4/(1/3/2)=24
4/((1/3)/2)=24




SQL> exec proc24(5,5,5,1);

(5-1/5)*5=24
(5-(1/5))*5=24
(5-1/5)*5=24
(5-(1/5))*5=24
(5-1/5)*5=24
(5-(1/5))*5=24
(5-1/5)*5=24
(5-(1/5))*5=24
(5-1/5)*5=24
(5-(1/5))*5=24
(5-1/5)*5=24
(5-(1/5))*5=24
5*(5-1/5)=24
5*(5-(1/5))=24
5*(5-1/5)=24
5*(5-(1/5))=24
5*(5-1/5)=24
5*(5-(1/5))=24
5*(5-1/5)=24
5*(5-(1/5))=24
5*(5-1/5)=24
5*(5-(1/5))=24
5*(5-1/5)=24
5*(5-(1/5))=24

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表