• # D'autres

    Posté par (site web personnel) . En réponse au journal Un print(1 + "3a"), ça nous inspire comment ?. Évalué à 10. Dernière modification le 01 avril 2017 à 14:33.

    $ echo $((1 + "3a"))
    bash: 1 + 3a : valeur trop grande pour la base (le symbole erroné est « 3a »)
    zsh: bad math expression: operand expected at `"3a"'
    ksh: 1 + "3a": unexpected '"'
    dash: 1: arithmetic expression: expecting primary: "1 + "3a""
    
    $ echo "<?php print 1+\"3a\" ?>"|php5
    4
    
    $ units
    Currency exchange rates from www.timegenie.com on 2016年06月21日 
    2926 units, 109 prefixes, 88 nonlinear units
    You have: 1+"3a"
    Unknown unit '"3a"'
    
    $ cat t.cpp 
    #include <iostream>
    int main() {
     std::cout << 1 + "3a" << std::endl;
    }
    $ g++ -Wall -pedantic t.cpp 
    $ ./a.out 
    a