zoukankan      html  css  js  c++  java
  • 4 bit all 15

    3
    1 0001  -1
    2 0010  -2
    8 1000  -4
    4 0100  -3
    2
    3 0011   -1 2
    5 0101   -1 3
    6 0110   -2 3
    9 1001   -1 4
    10 1010  -2 4
    12 1100  -3 4
    1
    7 0111   -1 2 3
    11 1011  -1 2 4
    13 1101  -1 3 4
    14 1110  -2 3 4
    0
    15 1111  -1 2 3 4
    
    0 0
    1 0001 -1
    3 0011 -1 2
    7 0111 -1 2 3
    15 1111- 1 2 3 4
    9 1001  -1 4
    5 0101  -1 3
    11 1011 -1 2 4
    13 1101 -1 3 4
    
    2 0010 - 2
    6 0110 -2 3
    14 1110 -2 3 4
    10 1010 - 2 4
    
    8 1000 -4
    4 0100 -3
    12 1100 -3 4
    case  4 bit
     1
     2
     3
     4
     ...
     15
    
    
    0 0
    1 0001 -1
    2 0010 - 2
    3 0011 -1 2
    4 0100 -3
    5 0101  -1 3
    6 0110 -2 3
    7 0111 -1 2 3
    8 1000 -4
    9 1001  -1 4
    10 1010 - 2 4
    11 1011 -1 2 4
    12 1100 -3 4
    13 1101 -1 3 4
    14 1110 -2 3 4
    15 1111- 1 2 3 4
    
    var
      i: integer;
      b: byte;
    begin
      i := 0;
      b := 1;
      case i of
        0: //0000
          case b of
            1: i := 1;
            2: i := 2;
            3: i := 4;
            4: i := 8;
          end;
        1://0001
          case b of
            //1:i:=1;
            2: i := 3;
            3: i := 5;
            4: i := 9;
          end;
        2://0010
          case b of
            1: i := 3;
            //2:i:=3;
            3: i := 6;
            4: i := 10;
          end;
        3://0011
          case b of
            //1:i:=3
            //2:i:=3;
            3: i := 7;
            4: i := 11;
          end;
        4://0100
          case b of
            1: i := 5;
            2: i := 6;
            //3:i:=7;
            4: i := 12;
          end;
        5://0101
          case b of
            //1:i:=5;
            2: i := 7;
            //3:i:=7;
            4: i := 13;
          end;
        6://0110
          case b of
            1: i := 7;
            //2:i:=7;
            //3:i:=7;
            4: i := 14;
          end;
        7://0111
          case b of
            //1:i:=7;
            //2:i:=7;
            //3:i:=7;
            4: i := 15;
          end;
        8://1000
          case b of
            1: i := 9;
            2: i := 10;
            3: i := 12;
            //4:i:=15;
          end;
        9://1001
          case b of
            //1:i:=7
            2: i := 11;
            3: i := 13;
            //4:i:=15;
          end;
        10://1010
          case b of
            1: i := 11;
            //2:i:=7;
            3: i := 14;
            //4:i:=15;
          end;
        11://1011
          case b of
            //1:i:=7
            //2:i:=7;
            3: i := 15;
            //4:i:=15;
          end;
        12://1100
          case b of
            1: i := 13;
            2: i := 14;
            //3:i:=7;
            //4:i:=15;
          end;
        13://1101
          case b of
            //1:i:=13;
            2: i := 15;
            //3:i:=7;
            //4:i:=15;
          end;
        14://1110
          case b of
            1: i := 15;
            //2:i:=14;
            //3:i:=7;
            //4:i:=15;
          end;
        15: ;//1111
      end;
    end;  
    

    https://www.onlinegdb.com/online_pascal_compiler
    https://rextester.com/l/pascal_online_compiler
    在线编译

    var
      i: integer;
      b: byte;
    begin
      i := 0;
      b := 1;
      case i of
        0: //0000
          case b of
            1: i := 1;
            2: i := 2;
            3: i := 4;
            4: i := 8;
          end;
        1://0001
          case b of  //1
            //1:i:=1;
            2: i := 3;
            3: i := 5;
            4: i := 9;
          end;
        2://0010
          case b of  //2
            1: i := 3;
            //2:i:=3;
            3: i := 6;
            4: i := 10;
          end;
        3://0011
          case b of  //1 2
            //1:i:=3
            //2:i:=3;
            3: i := 7;
            4: i := 11;
          end;
        4://0100
          case b of // 3
            1: i := 5;
            2: i := 6;
            //3:i:=7;
            4: i := 12;
          end;
        5://0101
          case b of   // 1 3
            //1:i:=5;
            2: i := 7;
            //3:i:=7;
            4: i := 13;
          end;
        6://0110
          case b of  // 2 3
            1: i := 7;
            //2:i:=7;
            //3:i:=7;
            4: i := 14;
          end;
        7://0111
          case b of   //1 2 3
            //1:i:=7;
            //2:i:=7;
            //3:i:=7;
            4: i := 15;
          end;
        8://1000
          case b of  // 4
            1: i := 9;
            2: i := 10;
            3: i := 12;
            //4:i:=15;
          end;
        9://1001
          case b of // 1 4
            //1:i:=7
            2: i := 11;
            3: i := 13;
            //4:i:=15;
          end;
        10://1010
          case b of // 2 4
            1: i := 11;
            //2:i:=7;
            3: i := 14;
            //4:i:=15;
          end;
        11://1011
          case b of  // 1 2 4
            //1:i:=7
            //2:i:=7;
            3: i := 15;
            //4:i:=15;
          end;
        12://1100
          case b of  // 3 4
            1: i := 13;
            2: i := 14;
            //3:i:=7;
            //4:i:=15;
          end;
        13://1101
          case b of  // 1 3 4
            //1:i:=13;
            2: i := 15;
            //3:i:=7;
            //4:i:=15;
          end;
        14://1110
          case b of // 2 3 4
            1: i := 15;
            //2:i:=14;
            //3:i:=7;
            //4:i:=15;
          end;
        15: ;//1111  //1 2 3 4
      end;
      ShowMessage(IntToStr(i));
    end; 
    

    可用

    var
      i: integer;
      b: byte;
    begin
      i := 0;
      b := 1;
      case i of
        0: //0000
          case b of
            1: i := 1;
            2: i := 2;
            3: i := 4;
            4: i := 8;
          end;
        1://0001
          case b of  //可用2 3 4
            //1:i:=1;
            2: i := 3;
            3: i := 5;
            4: i := 9;
          end;
        2://0010
          case b of  //可用 1 3 4
            1: i := 3;
            //2:i:=3;
            3: i := 6;
            4: i := 10;
          end;
        3://0011
          case b of  //可用 3 4
            //1:i:=3
            //2:i:=3;
            3: i := 7;
            4: i := 11;
          end;
        4://0100
          case b of // 可用 1 2 4
            1: i := 5;
            2: i := 6;
            //3:i:=7;
            4: i := 12;
          end;
        5://0101
          case b of   // 可用 2 4
            //1:i:=5;
            2: i := 7;
            //3:i:=7;
            4: i := 13;
          end;
        6://0110
          case b of  //可用 1 4
            1: i := 7;
            //2:i:=7;
            //3:i:=7;
            4: i := 14;
          end;
        7://0111
          case b of   //可用 4
            //1:i:=7;
            //2:i:=7;
            //3:i:=7;
            4: i := 15;
          end;
        8://1000
          case b of  //可用 1 2 3
            1: i := 9;
            2: i := 10;
            3: i := 12;
            //4:i:=15;
          end;
        9://1001
          case b of // 可用 2 3
            //1:i:=7
            2: i := 11;
            3: i := 13;
            //4:i:=15;
          end;
        10://1010
          case b of // 可用 1 3
            1: i := 11;
            //2:i:=7;
            3: i := 14;
            //4:i:=15;
          end;
        11://1011
          case b of  //可用 3
            //1:i:=7
            //2:i:=7;
            3: i := 15;
            //4:i:=15;
          end;
        12://1100
          case b of  //可用 1 2
            1: i := 13;
            2: i := 14;
            //3:i:=7;
            //4:i:=15;
          end;
        13://1101
          case b of  // 可用 2
            //1:i:=13;
            2: i := 15;
            //3:i:=7;
            //4:i:=15;
          end;
        14://1110
          case b of // 可用 1
            1: i := 15;
            //2:i:=14;
            //3:i:=7;
            //4:i:=15;
          end;
        15: ;//1111 可用无 //1 2 3 4
      end;
      ShowMessage(IntToStr(i));
    end;  
    
  • 相关阅读:
    裸二分图匹配poj1469
    洛谷——P2038 无线网络发射器选址
    洛谷—— P1041 传染病控制
    洛谷—— P1784 数独
    Vijos——T 1092 全排列
    Vijos—— T 1359 Superprime
    高并发解决方案--负载均衡
    request 发送多层字典
    June 11th 2017 Week 24th Sunday
    June 10th 2017 Week 23rd Saturday
  • 原文地址:https://www.cnblogs.com/marklove/p/14803348.html
Copyright © 2011-2022 走看看