• [^] # Re: Je cherche à comprendre

    Posté par . En réponse à la dépêche Le langage D. Évalué à 2. Dernière modification le 09 juin 2012 à 18:34.

    import std.stdio;
    import std.array;
    void main ( string[] args){
     if( args.length == 2 )
     writefln("Bonjour: %s", args[1] );
     else if ( args.length > 2 )
     writefln("Bonjour: %s", args[1..$].join(", ") );
     else
     writefln("Bonjour" );
    }
    
    
    $ ./t
    Bonjour
    $ ./t jean paul eric
    Bonjour: jean, paul, eric