13 
 
        
      
      扩大比较链
      
  与大多数语言不同,Python a<b<c会像在数学中一样进行评估,实际上是比较三个数字,而不是将布尔值a<b与进行比较c。用C(以及许多其他语言)编写此代码的正确方法是a<b && b<c。 在这个挑战中,您的任务是将这样任意长度的比较链从Python /直观表示扩展到如何用其他语言编写。 技术指标 您的程序必须要处理运算符:==, !=, <, >, <=, >=。 输入将具有仅使用整数的比较链。 不用担心一路比较的真实性,这纯粹是语法/语法上的挑战。 输入将没有任何空格,以防止答案因分割空格而使解析变得琐碎。 但是,您的输出可能只有一个空格,要么仅包含&&,要么包含比较运算符和&&,或者两者都不包含,但是要保持一致。 测试用例 Input Output --------------------------------------------------------------- 3<4<5 3<4 && 4<5 3<4<5<6<7<8<9 3<4 && 4<5 && 5<6 && 6<7 && 7<8 && 8<9 3<5==6<19 3<5 && 5==6 && 6<19 10>=5<7!=20 10>=5 && 5<7 && 7!=20 15==15==15==15==15 …
      
        
          
                   9
                
        
        
          
                  
                    code-golf 
                  
                    parsing 
                  
                    conversion 
                  
                    syntax 
                  
                    code-golf 
                  
                    sequence 
                  
                    primes 
                  
                    code-challenge 
                  
                    geometry 
                  
                    optimization 
                  
                    code-golf 
                  
                    graph-theory 
                  
                    code-golf 
                  
                    number-theory 
                  
                    primes 
                  
                    integer 
                  
                    code-golf 
                  
                    source-layout 
                  
                    cops-and-robbers 
                  
                    code-golf 
                  
                    source-layout 
                  
                    cops-and-robbers 
                  
                    code-golf 
                  
                    sequence 
                  
                    primes 
                  
                    integer 
                  
                    code-golf 
                  
                    math 
                  
                    number-theory 
                  
                    primes 
                  
                    rational-numbers 
                  
                    code-golf 
                  
                    math 
                  
                    sequence 
                  
                    number-theory 
                  
                    primes 
                  
                    code-golf 
                  
                    string 
                  
                    code-golf 
                  
                    math 
                  
                    combinatorics 
                  
                    permutations 
                  
                    restricted-complexity 
                  
                    code-golf 
                  
                    array-manipulation 
                  
                    code-golf 
                  
                    number 
                  
                    sequence 
                  
                    code-golf 
                  
                    number 
                  
                    sequence 
                  
                    code-golf 
                  
                    binary-matrix 
                  
                    code-golf 
                  
                    math 
                  
                    tips 
                  
                    javascript 
                  
                    algorithm 
                  
                    code-golf 
                  
                    string 
                  
                    code-golf 
                  
                    number 
                  
                    sequence 
                  
                    code-golf 
                  
                    math 
                  
                    arithmetic 
                  
                    parsing 
                  
                    code-golf 
                  
                    number 
                  
                    sequence 
                  
                    primes 
                  
                    code-golf 
                  
                    string 
                  
                    ascii-art 
                  
                    geometry 
                  
                    integer 
                  
                    code-golf 
                  
                    geometry 
                  
                    code-golf 
                  
                    number 
                  
                    array-manipulation 
                  
                    code-golf 
                  
                    math 
                  
                    geometry 
                  
                    code-golf 
                  
                    number 
                  
                    sequence 
                  
                    arithmetic 
                  
                    integer 
                  
                    code-golf 
                  
                    string 
                  
                    kolmogorov-complexity 
                  
                    code-golf 
                  
                    number 
                  
                    code-golf 
                  
                    number 
                  
                    chess 
                  
                    code-golf 
                  
                    sequence 
                  
                    decision-problem 
                  
                    subsequence 
                  
                    code-golf 
                  
                    math 
                  
                    number 
                  
                    primes 
                  
                    code-golf 
                  
                    primes 
                  
                    permutations 
                  
                    code-golf 
                  
                    integer 
                  
                    probability-theory 
                  
                    statistics 
                  
                    code-golf 
                  
                    string 
                  
                    code-golf 
                  
                    sequence 
                  
                    decision-problem 
                  
                    parsing 
                  
                    board-game 
                  
                    code-golf 
                  
                    binary 
                  
                    graph-theory 
                  
                    code-golf 
                  
                    board-game 
                  
                    classification 
                  
                    tic-tac-toe 
                  
                    code-golf 
                  
                    ascii-art 
                  
                    polyglot 
                  
                    code-golf 
                  
                    date 
                  
                    code-golf 
                  
                    geometry