text:
Capitalize first letter of each word of input
This is a relatively quick one, but I'm sure you'll like it.
Codegolf a program that will take input in the form of a sentence and then provide the output with the first letter capitalized in each word.
Rules:

Submissions may not be in the form of a function. So no:
function x(y){z=some_kind_of_magic(y);return z;} as your final answer... Your code must show that it takes input, and provides output.
The code must preserve any other capital letters the input has. So
eCommerce and eBusiness are cool, don't you agree, Richard III?

will be rendered as
ECommerce And EBusiness Are Cool, Don't You Agree, Richard III?

Some of you may be thinking, "Easy, I'll just use regex!" and so using the native regex in your chosen golfing language will incur a 30 character penalty which will be applied to your final code count. Evil laugh
A "word" in this case is anything separated by a space. Therefore palate cleanser is two words, whereas pigeon-toed is considered one word. if_you_love_her_then_you_should_put_a_ring_on_it is considered one word. If a word starts with a non-alphabetical character, the word is preserved, so _this after rendering remains as _this. (Kudos to Martin Buttner for pointing this test case out).

4b. There is no guarantee that words in the input phrase will be separated by a single space.

Test Case, (please use to test your code):
Input:
eCommerce rocks. crazyCamelCase stuff. _those  pigeon-toed shennanigans. Fiery trailblazing 345 thirty-two Roger. The quick brown fox jumped over the lazy dogs. Clancy Brown would have been cool as Lex Luthor. good_bye

Output:
ECommerce Rocks. CrazyCamelCase Stuff. _those  Pigeon-toed Shennanigans. Fiery Trailblazing 345 Thirty-two Roger. The Quick Brown Fox Jumped Over The Lazy Dogs. Clancy Brown Would Have Been Cool As Lex Luthor. Good_bye

This is code golf, shortest code wins...

Good luck...

Oh crap, I was thinking of multiple spaces but forgot to mention it... I've updated the brief accordingly... The brief will be locked from this point forward.

What about spaces at the end of the line? Do we have to preserve them? Can we add one if it serves our needs?

Dennis, please preserve spaces from the input...

!= TitleCase dam it! c# loses AGAIN!

@WallyWest I don't think there should be a at the end of the example output? Also a double spacebefore Pigeon-toed`?

@Tim The double space before Pigeon-toed is correct. He said to preserve spacing.

What separates the words?  Any whitespace (tabs, newlines, etc) or just spaces?

Is this ASCII only or should the answer handle unicode?

@StevenRumbalski just standard space (ASCII 32)

@Bakuriu At this point it's just standard ASCII...

Does ”Ascii only” mean that answers that correctly capitalize e.g. ä to Ä are incorrent? Such as this one: http://codegolf.stackexchange.com/questions/49950/capitalize-first-letter-of-each-word-of-input#answer-49956

@leo: Reading the OP's comment in context, it says the code doesn't have to handle non-ASCII characters. I'd say that means behavior for non-ASCII letters is undefined.

Not even an honorable mention for the 13-byte Perl solution?

Honorable mention made! Nice work!

CJam, 15 13 bytes
Lq{_eu?_S-}/;

Try it online in the CJam interpreter.
Pseudocode
L             e# B := ""
 q            e# Q := input()
  {       }/  e# for C in Q:
   _eu?       e#     C := B ? C : uppercase(C)
       _S-    e#     B := string(C).strip(" ")
            ; e# discard(B)

All modified characters C are left on the stack and, therefore, printed when exiting.

Damn this is clever. D:

I have to agree, outgolfing someone by 4 chars in a codegolf language is a feat in itself... well done.

@WallyWest: Golfing languages can give the impression that they kinda golf themselves, but I assure you that they don't. TMTOWTDI is true for all languages and especially for those with a lot of built-ins. Sometimes you win, sometimes you lose and sometimes you feel like you've been hit by a truck.

CSS 2.1, 49
:after{content:attr(t);text-transform:capitalize}

Explanation:

The attr function takes the input from a t (text) HTML attribute.
The input is capitalized by setting text-transform to capitalize.
The output is provided as a generated content, using the content property on an ::after pseudo-element.

Runnable snippet:

:after {
    content: attr(t);
    text-transform: capitalize;
}

Note: CSS 2.1 specified the desired behavior: capitalize uppercased the first character of each word. However, CSS3 uppercases first typographic letter unit of each word. So the snippet above won't work properly neither on old IE, which didn't follow CSS 2.1; nor on new compliant browsers which follow CSS3.

Oh, this is clever!

(too bad about the _those problem on CSS3 browsers, but I'm still upvoting because of the unique way of solving the problem.)

@Oriol, "oh this is clever!" indeed! Sorry IQAndreas, I have to borrow your comment here... this is an ingenious approach to solving the problem... i will have to make use of this approach...

Perl, 13 bytes
perl -040pe '$_="\u$_"'

9 bytes plus 4 bytes for 040p (assuming I've interpreted the rules on special invocations correctly).
-040 sets the input record separator $/ to a single space, so spaces are preserved; the \u escape sequence converts the next character to title case.

Great work, honorable mention for using the command line!

Javascript (ES6), 77 bytes

alert(prompt().split(' ').map(x=>x&&x[0].toUpperCase()+x.slice(1)).join(' '))

Commented
alert( // output
    prompt(). // take input
    split(' '). // split by spaces
    map(x=> // map function to array
        x && // if x, empty string "" is falsey and returns itself
        x[0].toUpperCase() + x.slice(1) // capaitalize 1st char and concatenate the rest
    ).
    join(' ') // join array with spaces
)

What happens if words are separated by multiple spaces? [4b]

@Caek It's handled by the x&&. An empty string is falsey so the && short-circuits and returns the left operand, the empty string. Spaces are preserved.

Awesome, thanks for the explanation. Might help me figure out how I can get it to work now.

This will capitalize even non Ascii characters, so that å will become Å!

-4 bytes by calling split\ `andjoin` `` as Tagged Templates

Perl Version < 5.18, 30 27 26 25
say map"\u$_",split$,=$"

24 characters +1 for -n.
\u makes the next character in a string uppercase. @ThisSuitIsBlackNot pointed this out to save 1 byte. Before we were using the function ucfirst.
From the perldocs,

As another special case, split emulates the default behavior of the
  command line tool awk when the PATTERN is either omitted or a literal
  string composed of a single space character (such as ' ' or "\x20" ,
  but not e.g. / / ). In this case, any leading whitespace in EXPR is
  removed before splitting occurs, and the PATTERN is instead treated as
  if it were /\s+/ ; in particular, this means that any contiguous
  whitespace (not just a single space character) is used as a separator.
  However, this special treatment can be avoided by specifying the
  pattern / / instead of the string " " , thereby allowing only a single
  space character to be a separator. In earlier Perls this special case
  was restricted to the use of a plain " " as the pattern argument to
  split, in Perl 5.18.0 and later this special case is triggered by any
  expression which evaluates as the simple string " " .

Since $" evaluates to a space, this will preserve the spaces. Since we want to both set $, to a space character, and input a space character to the split, @nutki pointed out we can do both as the input to the split. That saves 3 bytes from what we had before, which was first setting $, and then inputting $" to the split.
Using a , for map instead of {} saves an additional byte, as @alexander-brett pointed out.
Run with:
echo 'eCommerce     rocks. crazyCamelCase stuff. _those  pigeon-toed shennanigans. Fiery trailblazing 345 thirty-two Roger. The quick brown fox jumped over the lazy dogs. Clancy Brown would have been cool as Lex Luthor. good_bye' | perl -nE'say map"\u$_",split$,=$"'

Save 1 byte with ...map"\u$_",split...

@alexander-brett thanks! I updated the answer.

CJam, 17 15 bytes
lS/{S+(eu\+}/W<

Test it here.
Fairly straightforward implementation of the spec. Make use of the new {}& to avoid errors for consecutive spaces.
Two bytes saved by Dennis.

Great stuff! Is CJam primarily just a golfing language or does it have some practical commercial applications?

@WallyWest No it's just a golfing language. It definitely doesn't have commercial applications, but I personally use it occasionally for quick throw-away scripts (because it has a lot of built-ins, and if you know what you're doing, then typing fewer characters is quicker than typing more characters ;)).

You can save a few bytes by appending a space to each word. Depending  on the OP's answer to my question, this could get you to either 14 or 12 bytes.

@Dennis Oh right, I was playing around with that, but didn't consider simply adding it before pulling off the first character. I'll change that tomorrow, thank you!

@Dennis Thanks, I changed it, but I'm not sure what 14-byte version you meant. If you're talking about omitting the second +, then that breaks if the input contains trailing spaces.

Yes, I miscounted the spaces. :(

C, 64 63 bytes
a;main(c){while(~(c=getchar()))putchar(a?c:toupper(c)),a=c-32;}

Fix: some compilers (such as Clang) don't like an int parameters in place of argv, so I moved it to a global variable. The byte count stays the same. Thanks to squeamish ossifrage for noticing.
Down to 63 bytes, thanks Dennis.
Ungolfed:
int a;

int main(int c) {
    while(~(c = getchar()))
        putchar(a ? c : toupper(c)),
        a = c - ' ';
}

Pretty straightforward: if a is false, the character is converted to uppercase. It is set after reading a space: c - ' ' is false only if c == ' '. toupper() ignores everything that is not a lowercase letter, so symbols and multiple spaces are fine. -1 has all bits set, so when getchar() returns -1 the NOT operator makes it zero, and the loop stops.
a is declared as a global variable, so it is initializd to zero (false). This ensures that the first word is capitalized.

while(~(c=getchar()) — I like that. Clang won't actually compile this, but you can get the same character count with c;main(a){...}

If you swap the declarations of a and c and the order of the ternary operator, you can replace == with - to save one byte.

You are right, of course.

Nice! +1 The program would work the same when using while(!(c = getchar())), right?

@Cool Guy: Nope, the bitwise ~ and the logical ! are not the same. In C anything that is not zero is considered true, so your condition would be like while((c = getchar()) == 0) which of course won't work. The bitwise NOT operator ~ negates the value bit-by-bit. To break the loop, ~c must be zero: this means that all bits have to be one, so that when negated they become all zeroes. That value (for a 32bit int) is 0xFFFFFFFF, which, if signed, is -1 (EOF).

putchar(c>96?c&&95:c) //lowercase letters are 64 more than upper case letters, and begin at 97. this will do funny things to words begining with chars above 'z'

62 bytes

Python 3, 59 56 bytes
f=1
for c in input():print(end=f*c.upper()or c);f=c==" "

Thanks to @Reticality for 3 bytes.

How about print(end=f*c.upper()or c)? That would save 4 bytes

@Reticality Oh wow, I had no idea you could have an empty print with just a keyword arg. Thanks!

JAVA, 273 bytes
EDIT
import static java.lang.System.*;class x{public static void main(String[] s){char[] a=new java.util.Scanner(in).nextLine().toCharArray();boolean f=1>0;for(int i=0;i0;continue;}if(f){a[i]=Character.toUpperCase(a[i]);f=1<0;}}out.println(a);}}

This is my first answer in PCG, not sure if this is acceptable.

Welcome aboard! You might try removing whitespace and using single characters for variable names. There are some other tips for golfing JAVA as well.

Thanks @nderscore for the hint, I have edited my answer using the tips.

Looking better! I also added the byte count into your post for you.

You can save a few by removing import java.util.*; and replacing Scanner with java.util.Scanner.

You can remove the spaces in f = 1>0;.

Thanks guys for comment...answer updated as per your comments

The public keyword isn't necessary so that can save you 7 bytes.

@TuukkaX He doesn't have public in front of the class.. And if you mean he can remove the public in front of the static void main(..., then you are wrong, unless he also changes the class to interface and uses Java 8+.

@KevinCruijssen yup, my mistake!

><> (Fish), 39 bytes
</?-' 'o:;?(0:<-*' '*('{'$)'`'::i
i/.0e

Method:

Take one char and capitalize it if in range a-z then print it out. (left-to-right code for this part is i::'backquote')$'{'(*' '*+)
If the last taken char is an EOF char then exit else print it
If the last taken char is a space char then go to point 1 else take a new letter and go to point 2.

JavaScript (regex solution) - 104 bytes
Someone has to bite the bullet and post the RegEx solution! 74 characters, plus the +30 character penalty:
alert(prompt().replace(/(^| )[a-z]/g,function(m){return m.toUpperCase()}))

Or if you want to read and understand the code in its non-compacted fashion:
//     Matches the (beginning of the line or a space), followed by a lowercase English character.
string.replace( /(^| )[a-z]/g ,
                function(match) { return match.toUpperCase(); }

Clever... though of course, you've paid the price with a 30 character penalty... I take my hat off to you for biting the bullet...

Vim, 11, 10 bytes
qqvUW@qq@q

Explanation:
qq           #Start recording in register 'q'
  vU        #Make the character under the cursor uppercase
     W       #Move forward a WORD
      @q     #recursively call macro 'q'
        q    #stop recording
         @q  #Call the recursive macro

Do I get a gold-badge for outgolfing Dennis?

Yes, here's your gold badge

brainfuck, 342 310 bytes
>-[-[-<]>>+<]>-[->+>>>>+<<<<<]>[-<+>],[<[->>+>+<<<]>>>[-<<<+>>>]<<[->>+>+<<<]>>>[-<<<+>>>]<<[->-<]>>+<[>->>>+[+[<]>>+<+]>[-<<<<<<->>>>>>]<<<+++++[>+++++<-]>+>>+<<[<<<<[->+>>+<<<]>[-<+>]>>[[-]>>+<<]>>-[<<<[-<<<<->>>>]>>>+>-<]<<<<<->>>>-]>>[-<<<<[-]>>>>]<<<<<<[-]]>[->[-]<<<<<[->>>+>>+<<<<<]>>>[-<<<+>>>]>]<<<.,]

Try it online!
Explanation:
[
* Many constants were taken from the BF constants page on esolangs.org.
*
* Cells:
*
* true number: the true index of the cell
* fake number: the relative cell index as referenced in the code
*
* true# | fake# | info
*   0       -     Used only for initialization of (fake) cell 0
*   1       -     Used only for initialization of (fake) cell 0
*   2       -     Used only for initialization of (fake) cell 0
*   3       -     Used only for initialization of (fake) cell 0
*   4       0     Holds constant 32 / ' ', which is used for cell 5 (space flag) and for subtracting (' ') from input
*   5       1     Holds the input/output char during the main loop. Also used in setup for copying cell 0 to cell 5
*   6       2     Used to hold 32 / ' ' (temporarily, to subtract it from the input)
*   7       3     Used to hold a copy of the input that gets mangled throughout the loop, being subtracted from to
*                 check what the input character was. Also used in space code to copy cell 0 to cell 5.
*   8       4     Used primarily as a flag to decide which part of the space/not space conditional to run (if 1, the
*                 space code runs; if 0, the not-space code runs). Also used when copying cell 3 to 6 (for checking
*                 if cell 3 == 0), and to copy cell 1 to 3 (input).
*   9       5     Holds the 'space flag' (different from cell 4). When a space is encountered, this cell is set to 32
*                 ('a' - 'A'). When a lowercase character is encountered, this cell is subtracted cell 1 (input),
*                 clearing it by default (subtraction without copying implicitly clears the cell). This makes it so
*                 that only the first character after a space is converted to uppercase.
*   10      6     Used as a temporary cell when initializing constants 65 ('a' - ' ') and 2, also used in the
*                 lowercase check loop to set cell 8 (cell 3 == 0 flag)
*   11      7     Used as the counter in the lowercase check loop, goes from 26 to 0 (decrementing each iteration).
*                 Also used as a temporary cell when initializing constant 65.
*   12      8     Used to hold (cell 3 == 0) flag, which subtracts cell 5 from cell 1 if it is 1 (which means that
*                 cell 1 is a lowercase letter).
*   13      9     Used as a flag to figure out if the else branch of the lowercase checker should run. If one, the
*                 character is not a lowercase letter or space and so cell 5 is cleared.
]

>-[-[-<]>>+<]>-    set cell 0 to 32 (=' ')

[->+>>>>+<<<<<]    set cells 1 and 5 to 32 (end on 0)
>[-<+>]            move 1 back to 0 (end on 1)

,[                 loop over input (cell 1)

    copy cell 0 to cell 2
    <[->>+>+<<<]     [move cell 0 to cells 2 and 3 (end on 0)]
    >>>[-<<<+>>>]    [move cell 3 back to cell 0 (end on 3)]

    copy cell 1 to cell 3
    <<[->>+>+<<<]    [move cell 1 to cells 3 and 4 (end on 1)]
    >>>[-<<<+>>>]    [move cell 4 back to cell 1 (end on 4)]

    <<[->-<]         [subtract cell 2 from cell 3 (end on 2)]

    >                cell 3 / input minus ' '

    >+<              set cell 4 as flag to run space code if set (end on 3)

    [                not space branch (check if in lowercase zone)
        >-                 clear cell 4 (end on 4)

        >>>+[+[<]>>+<+]>   set cell 9 to 65 (='a' minus ' ') (uses 6 7 8 as tmp) (end on 9)

        [-<<<<<<->>>>>>]   [subtract cell 9 from cell 3 (end on 9)]

        [need to check if cell 3 is from 0-26, it could be above and not a lowercase letter]

        <<<                cell 6
        +++++[>+++++<-]>+  set cell 7 to 26
        >>+<<              set cell 9 to 1 (end on 7)

        [                  do 26 times

            <<<<                   cell 3
            [->+>>+<<<]            [move cell 3 to cell 4 and 6 (end on 3)]
            >[-<+>]                [move cell 4 back to cell 3 (end on 4)]

            >>                     cell 6

            [[-]>>+<<]             [if cell 6 is set, set cell 8 to 1 (end on 6)]

            >>-                    decrement cell 8 (if cell 3 was not zero cell 8 is now zero) (if cell 3 was zero cell 8 is now 255)

            [                      if cell 3 is zero (start here on 8)
                <<<                    cell 5
                [-<<<<->>>>]           [sub cell 5 from cell 1 (end on 5)]

                >>>+                   clear cell 8 (end on 8)
                >-<                    set cell 9 to 0 (end on 8)
            ]

            <<<<<-                 decrement cell 3 (end on 3)
            >>>>-                  end on 7 and decrement
        ]

        >>[                cell 9 set (else branch so we have no lowercase letter)
            -                  [clear cell 9]

            <<<<               cell 5
            [-]                [clear cell 5]
            >>>>               cell 9
        ]

        <<<<<<             cell 3
        [-]                [clear cell 3]
    ]

    >                cell 4
    [                space branch
        -                      clear cell 4 (end on 4)

        >[-]                   clear cell 5 (space flag/may have been set)
        <<<<<[->>>+>>+<<<<<]   [set space flag (cell 5) (coincidentally, it is also 32 so we can copy from cell 0) (0-> 5 and 3) (end on 0)]
        >>>[-<<<+>>>]          [3 to 0 (end on 3)]

        >                      end on 4
    ]

    <<<.             from 4 to 1 (output 1)
,]

Python 2, 73 bytes
i=raw_input()
print''.join((c,c.upper())[p==' ']for p,c in zip(' '+i,i))

This program capitalises a letter if preceded by a space (with a kludge for the first character in the string). It relies on the .upper() string method to capitalise correctly.

You could save 2 bytes by porting to Python 3.  (-4 raw_input => input, +2 print => print())

Thanks Steven. I had considered the savings in bytes by coding in Python 3. Then I thought, if I was to change language to be competitive, I would change to Pyth. I am happy to compete in the Python 2 sub-league. I code in Python 2 every day for work, so this experience makes me better at my job (but my work code is not golfed!).

PHP 64 76 77 83 84 89 bytes
Does $_GET count as input in PHP?
If so, here is my first CG attempt
foreach(explode(' ',$_GET[@s])as$k=>$v)echo$k?' ':'',ucfirst($v)

Thanks manatwork :)
One could just use the ucwords function, which would result in 21 bytes:
<?=ucwords($_GET[@s])

thanks Harry Mustoe-Playfair :)

Personally I consider only fgets(STDIN) to read input. But we have no consensus on $_GET as far as I know.

Yup, that works :D

You don't need the tricks to shut up the warnings. Thei're warnings! Nobody cares about them.

Well, didn't thought of that. Guess I'll have to stick to substr

No need for that. It's just time to forget my earlier advice on removing $k=>. Put it back: foreach(split(' ',$_GET[@s])as$k=>$v)echo$k?' ':'',ucfirst($v);

I didn't knew that you could echo multiple "things" with ,
Thanks :)
split() is deprecated as of PHP 5.3 so we have to use @ once again.
But doesn't add split() +30 to the bytecount? Since it splits by regex

Not sure. I considered that split(' ') equivalent of splitting on string space as used in Perl, Ruby and JavaScript answers too.

<?= ucwords($_GET[@s]) is one byte shorter! 22

you do not even need the space between = and ucwords

I think that $k?' ':'', can be changed into !$k?:' ',, which is 1 byte shorter.

This won't work, because if $k evaluates to true it will return 1 which is then echoed

Haskell, 69
import Data.Char
main=interact$tail.scanl(!)' '
' '!c=toUpper c;_!c=c

Explanation:
scanl takes a function (a -> b -> a) and an initial value a, then iterates over a list of [b]s to make a list of [a]s:
scanl (!) z [a,b,c] == [   z
                       ,   z ! a
                       ,  (z ! a) ! b
                       , ((z ! a) ! b) ! c]

It repeatedly takes the previous result as the left argument of the function passed to it, and a value from the input list as the right argument, to make the next one.
I wrote a function (!) :: Char -> Char -> Char that returns the right character you pass it, but capitalizes it if the left char is ' ' (space). For scanl, this means: return the value from the input list, but capitalize it if the previous result was a space. So scanl (!) ' ' "ab cd" becomes:
    scanl (!) ' ' "ab cd"
==> ' ' : scanl (!) (' ' ! 'a') "b cd"
==> ' ' : scanl (!)     'A'     "b cd"
==> ' ' : 'A' : scanl (!) ('A' ! 'b') " cd"
==> ' ' : 'A' : scanl (!)     'b'     " cd"
==> ' ' : 'A' : 'b' : scanl (!) ('b' ! ' ') "cd"
==> ' ' : 'A' : 'b' : scanl (!)     ' '     "cd"
==> ' ' : 'A' : 'b' : ' ' : scanl (!) (' ' ! 'c') "d"
==> ' ' : 'A' : 'b' : ' ' : scanl (!)     'C'     "d"
==> ' ' : 'A' : 'b' : ' ' : 'C' : scanl (!) ('C' ! 'd') ""
==> ' ' : 'A' : 'b' : ' ' : 'C' : scanl (!)     'd'     ""
==> ' ' : 'A' : 'b' : ' ' : 'C' : 'd' : ""
==> " Ab Cd"

We need the initial value ' ' to capitalize the first letter, but then we chop it off with tail to get our final result.

Nice! Can you please explain it for me?

I wrote an explanation.

Some more scanl examples: one, two.

@Mauris kudos for using such a great algorithmm like this... :)

Pyth, 20 bytes
uXGHr@GH1fqd@+dzTUzz

These multiple spaces really sucks. Otherwise there would have been a really easy 12 bytes solution.
Try it online: Pyth Compiler/Executor
Explanation
                      implicit: z = input string
         f       Uz   filter [0, 1, 2, ..., len(z)-1] for elements T, which satisfy:
          qd@+dzT        " " == (" " + z)[T]
                      (this finds all indices, which should be capitalized)
u                  z  reduce, start with G = z, for H in idices ^ update G by
 XGH                     replace the Hth char of G by
    r   1                upper-case of
     @GH                 G[H]
                      implicitly print result

edit: 16 chars is possible with @Dennis algorithm.

The multiple space thing is there to make it a lot more challenging... otherwise it would be a simple case of string.split(" ") or something similar... But you've done well to do it in 20 characters

PHP: 76 74 characters
foreach($l=str_split(fgets(STDIN))as$c){echo$l?ucfirst($c):$c;$l=$c==" ";}

Sample run:
bash-4.3$ php -r 'foreach($l=str_split(fgets(STDIN))as$c){echo$l?ucfirst($c):$c;$l=$c==" ";}' <<< 'eCommerce rocks. crazyCamelCase stuff. _those  pigeon-toed shennanigans. Fiery trailblazing 345 thirty-two Roger. The quick brown fox jumped over the lazy dogs. Clancy Brown would have been cool as Lex Luthor. good_bye'
ECommerce Rocks. CrazyCamelCase Stuff. _those  Pigeon-toed Shennanigans. Fiery Trailblazing 345 Thirty-two Roger. The Quick Brown Fox Jumped Over The Lazy Dogs. Clancy Brown Would Have Been Cool As Lex Luthor. Good_bye

Instead of ucfirst($c), use $c^' '. (Tip: if you bitwise-xor a letter with a space, it will be converted from uppercase to lowercase, and the oposite applies too)

@IsmaelMiguel, that works fine in your solution as you process only lowercase letters. But in my solution all first characters are processed. So for the (otherwise great) xor trick my code would also need some character type filtering. :(

That didn't crossed my mind. There must be a bitwise trick to check if it is a letter or not.

One thing you can do is $l=str_split(fgets(STDIN)), which reduces the code by 2 bytes!

Now I'm going mad. Man, how long I starred to that initialization and missed it. Thank you, @IsmaelMiguel.

You are welcome. I spent more than I should have ever spent to find something to shorten this. One thing you could do would be using as$l=>$c, but this way is 1 byte shorter. As an alternative to your fgets(STDIN), you can use $_GET[s] (it throws warnings, but ignore those or add @ before s). This way, it is still a standard input. And shorter. You save 4 bytes!

JAVA, 204 211 226 bytes
My first entry on CG, I hope it's fine:
class U{public static void main(String[]s){int i=0;char[]r=s[0].toCharArray();r[0]=Character.toUpperCase(r[0]);for(char c:r){if(c==' '&&i>0)r[i+1]=Character.toUpperCase(r[i+1]);i++;System.out.print(c);}}}

Saved 7 bytes thanks to @TNT

Involving my poor Java skills: public class U{public static void main(String[]s){int i=-1,j;char[]r=s[0].toCharArray();for(char c:r)if(++i==0||c==' '&&i>0)r[j=i+(i==0?0:1)]=Character.toUpperCase(r[j]);System.out.print(r);}}

Welcome to PPCG! The public modifier isn't necessary so you can save 7 more.

CJam, 14 bytes
It's not the shortest, but...
qS/Sf.{\eu}s1>

Another answer using similar ideas:
qS/Laf.{;eu}S*

.x only changes the first item if one of the parameters has only one item.

Chaining f and . is pretty ingenious. Another 14 bytes variant: qS/Sf.{\eu}S.-

Lua, 64 62 61 bytes
Lua is a horrendous language to golf in, so I'm pretty proud of myself for this one.
print(string.gsub(" "..io.read(),"%s%l",string.upper):sub(2))

[Try it here]1 Outdated, will update tommorow

Welcome to PPCG! Surely, you don't need those spaces after commas?

Wow, I'm so new to this I didnt even know spaces counted. 62 bytes!

I also just noticed it's not entirely correct: you are capitalising letters after all non-letters, so abc_def will give Abc_Def. However only letters after spaces should be turning into upper case. The good news is, fixing it saves a byte. ;)

C, 74 bytes
a,b=1;main(){while((a=getchar())>0)b=isspace(putchar(b?toupper(a):a));}

Makes no assumptions about the run-time character set (ASCII, EBCDIC, Baudot, ...whatever).  Does assume that EOF is negative (I think C guarantees that).
a,b=1;
main()
{
    while((a=getchar())>0)
        b=isspace(putchar(b?toupper(a):a));
}

a is the input character; b is true if the last character was space.  The only non-obvious bit is that we use the fact that putchar returns the character printed if there's no error.

C# Linq - 187
This is nowhere close to winning but I just love Linq too much.
namespace System{using Linq;class P{static void Main(string[]a){Console.Write(a[0].Substring(1).Aggregate(a[0][0].ToString().ToUpper(),(b,c)=>b[b.Length-1]==32?b+char.ToUpper(c):b+c));}}}

Java 8, 135 bytes
It's rare that I beat all the other answers that use the same language.
interface M{static void main(String[]a){int c=0;for(char i:a[0].toCharArray()){System.out.print(c==0?(i+"").toUpperCase():i);c=i-32;}}}

TIO

Suggest var i:a[0] instead of char i:a[0]

Bash, 61
a="${@//: / }"
a=(${a//: / })
a="${a[@]^}"
echo "${a//:/ }"

Note the colons are simply to make the program display OK here.  In reality these can be some non-printable character, such as BEL.
Output
$ ./cap1st.sh "eCommerce rocks. crazyCamelCase stuff. _those  pigeon-toed shennanigans. Fiery trailblazing 345 thirty-two Roger. The quick brown fox jumped over the lazy dogs. Clancy Brown would have been cool as Lex Luthor. good_bye"
ECommerce Rocks. CrazyCamelCase Stuff. _those  Pigeon-toed Shennanigans. Fiery Trailblazing 345 Thirty-two Roger. The Quick Brown Fox Jumped Over The Lazy Dogs. Clancy Brown Would Have Been Cool As Lex Luthor. Good_bye
$

Bash, 12
Sadly this one doesn't preserve leading/mutliple/trailing spaces, but otherwise it works:
echo "${@^}"

Output
$ ./cap1st.sh eCommerce rocks. crazyCamelCase stuff. _those  pigeon-toed shennanigans. Fiery trailblazing 345 thirty-two Roger. The quick brown fox jumped over the lazy dogs. Clancy Brown would have been cool as Lex Luthor. good_bye
ECommerce Rocks. CrazyCamelCase Stuff. _those Pigeon-toed Shennanigans. Fiery Trailblazing 345 Thirty-two Roger. The Quick Brown Fox Jumped Over The Lazy Dogs. Clancy Brown Would Have Been Cool As Lex Luthor. Good_bye
$

But that's half the challenge!

@Sp3000 there I fixed it (at as cost of 49 chars)

C#, 133 131
using C=System.Console;class P{static void Main(){var s=2>1;foreach(var c in C.ReadLine()){C.Write(s?char.ToUpper(c):c);s=c==32;}}}

Do you need &&c!=32? I'm not too fluent in C#, but I would guess that converting a space to uppercase results in a space.

Whoops, thanks - that was from before I made some other changes, I think. You're correct it's not needed.

try "using C=System.Console;" instead of using system

Pip, 15 + 1 for -s = 16
{IaUC:a@0a}Ma^s

Explanation:
                  a is first cmdline arg (implicit)
            a^s   Split a on spaces
{         }M      Map this function to each element:
 Ia                 If the word is not empty,
   UC:a@0             uppercase its first character
         a          Return the word
                  Output the resulting list (implicit) joined on spaces (-s flag)

One interesting feature of Pip that this program draws on is the : assignment meta-operator. Most C-like languages have some set of compute-and-assign operators: e.g. x*=5 does the same thing as x=x*5. In Pip, however, you can tack : onto any operator and turn it into a compute-and-assign operator. This even goes for unary operators. So -:x computes -x and assigns it back to x, the same as x:-x would. In this case, UC: is used (together with Pip's mutable strings) to uppercase the first character of a word.
The program takes input from the command-line, requiring an invocation like this:
python3 pip.py -se "{IaUC:a@0a}Ma^s" "test teSt TEST  _test"

JavaScript (SpiderMonkey 31 (1.8)) 63 70

// first version
// alert([for(c of x=prompt())[x?c.toUpperCase():c,x=c<'!'][0]].join(''))
// new version, thx @nderscore
[for(c of prompt(o=x=''))o+=x=x<'!'?c.toUpperCase():c],alert(o)

Nice method! Here's -3 : [for(c of x=prompt(o=''))(o+=x?c.toUpperCase():c,x=c<'!')],alert(o)

I can't sleep... so it's -7 now : [for(c of prompt(o=x=''))o+=x=x<'!'?c.toUpperCase():c];alert(o)

@nderscore wow your inexhaustible. I'm sorry I never find a way to give back

I'm just happy to aid in the quest for the smallest possible JS solution :)

Array comprehensions have been dropped from ES6 and ES7 altogether. Therefore, this is invalid JavaScript.

@chiru it can be invalid, but, curiously, it works. Should we call it "javascript as implemented in current release of FireFox"?

Well, it was an experimental SpiderMonkey feature, as it was planned for ES6 but later dropped, as no TC39 member wanted to champion it. It is not standards-compliant JavaScript and never was (and future releases of Firefox are likely drop its support).

@Chiru ok it is not standard-compliant. Who cares? It's code golf and it works.

@edc65 I'm just saying, this isn't "ES6" (which is what it says right on the top of the answer). It should rather be tagged "JavaScript SpiderMonkey 31 (1.8)", so future users are aware of why there are syntax errors when they try to run this.

@Chiru agreed. And thanx for giving the exact version.

R, 139 105 bytes
for(i in 1:length(p<-strsplit(readline(),"")[[1]])){if(i<2||p[i-1]==" ")p[i]=toupper(p[i])};cat(p,sep="")

Ungolfed + explanation:
# Assign p to be a vector of the input read from stdin, split into characters

for(i in 1:length(p <- strsplit(readline(), "")[[1]])) {

    # If we're at the first iteration or the previous character was a space

    if (i < 2 || p[i-1] == " ") {

        # Convert the current character to its uppercase equivalent

        p[i] <- toupper(p[i])
    }
}

# Join the vector elements into a single string and print it to stdout
cat(p, sep = "")

R with regex, 49 41 + 30 = 71 bytes
I'm really bummed; this actually has a better score using regular expressions with the penalty.
gsub("(^.| +.)","\\U\\1",readline(),pe=T)

This matches any single character at the beginning of the string or following any number of spaces and replaces it with an uppercase version of the capture. Note that applying \\U is legit and has no effect for non-letters. pe=T is interpreted as perl = TRUE since it takes advantage of R's partial matching of function parameters and the synonym for TRUE. For whatever reason, R doesn't use Perl-style regular expression by default.
Thanks to MickyT for helping save 8 bytes on the regex approach!

With your regex the matching string could be (^.| +.).  Uppercasing anything is OK.

@MickyT: Good idea, thanks! Edited to use your suggestion.

C, 125
Not the shortest of solutions, but I really like to golf in C.
char b[99];main(c){while(scanf("%[A-Za-z_-]",b)==1)islower(*b)&&(*b&=223),printf("%s",b);~(c=getchar())&&putchar(c)&&main();}

ungolfed:
char b[99];
main(c)
{
  while(scanf("%[A-Za-z_-]", b) == 1) {
    if(islower(b[0])) {
      b[0] &= 0xDF;
    }
    printf("%s", b);
  }
  if((c = getchar()) != -1) {
      putchar(c);
      main();
  }
}

I don't know wheter using regex-like syntax in scanf is streching the rules, but it works quite nicely. (Well, technically it's not a full regex)
An other thing to consider is that this code only works for words shorter than 99 bytes. But I think this solution will work for most cases.

Hint: &=223 --> -=32

Haskell: 127 characters

import Data.List
import Data.Char
i=isSpace
s a b=i a==i b
u (w:ws)=(toUpper w):ws
f w=concatMap u$groupBy s w
main=interact f

I got down to 69 bytes.

PHP, 82
echo join(' ',array_map(function($s){return ucfirst($s);},explode(' ',$argv[1])));

Usage :
$ php code.php "eCommerce rocks. crazyCamelCase stuff. _those  pigeon-toed shennanigans. Fiery trailblazing 345 thirty-two Roger. The quick brown fox jumped over the lazy dogs. Clancy Brown would have been cool as Lex Luthor. good_bye"

Java, 201 178 174 bytes
class C{public static void main(String[]a){for(String s:a[0].split(" ")){int c=s.length()>0?s.charAt(0):0;System.out.print((c>96&c<123?(char)(c-32)+s.substring(1):s)+" ");}}}

I'm back after realizing that my previous program did not preserve spaces.
First time I've had to submit an entire class before. Pass in the string as a command-line argument wrapped in quotes. (I never thought I could get it this short!)

I did them one better :^)

Python 2, 64 59 63
Try it here
This iterates through each word, converting the first character of each to uppercase, then printing it with a space after. I have to check if the split substring is not empty, which refers to multiple spaces in a row.
for w in raw_input().split(" "):print w and w[0].upper()+w[1:],

@StevenRumbalski Fixed.

I think you can do w and w[0].upper()+w[1:]. Not sure about the input format though.

@StevenRumbalski Fixed

Mathematica, 66 bytes
Print@StringReplace[InputString[],WordBoundary~~a_:>ToUpperCase@a]

I would use ToCamelCase, but it doesn't preserve spacing.

R, 96 93
A different approach than Alex A's.  I'm not using a loop, rather creating a another vector with a space prepended, then uppercasing any character in the original vector that is sitting under a space.
p=(strsplit(readline(),''))[[1]];s=c(' ',p);p[e]=toupper(p[e<-s==' ']);cat(head(p,-1),sep='')

Doesn't beat the regexp version though.
Edit I love it when you learn something new.  Replace p[-length(p)] with head(p,-1)

Python 3, 58 63 59 chars
print(*(c and c[0].upper()+c[1:] for c in input().split(" ")))

I have to add 5 characters because of bugfix

This not preserves multiple whitespaces.

Python 3, 101 bytes
x=list(' '+input())
for i in range(len(x)-1):
 if x[i-1]==' ':x[i]=x[i].title()
print(''.join(x[1:]))

V, 5 (non-competing)
$òBvU

Try it online!
Not too interesting. Just a direct port of my vim answer:
$        #Move to the last character
 ò       #Recursively
  B      #Move back a WORD
   vU    #Capitalize

Brachylog, 12 bytes
ṇ₁{ụʰ|}ᵐ~ṇ₁w

Try it online!
           w    Print
                the input
ṇ₁              split on spaces
  {   }ᵐ        with every word
    ʰ           having its first letter
   ụ            uppercased
     |          (without failing on empty words)
        ~ṇ₁     and then joined by spaces.

If this was allowed to be a function which would normalize runs of spaces to just one space, it would only be two bytes shorter: ṇ₁{ụʰ}ˢ~ṇ₁. That would be another two bytes shorter if we'd figured out how to parse chained metapredicates (ṇ₁ụʰˢ~ṇ₁), but since handling runs of spaces requires the |, it doesn't actually matter for this challenge.

05AB1E, 8 bytes
#εćuì}ðý

Try it online.
Explanation:"
#         # Split the (implicit) input-string by the space character
          # (multiple adjacent spaces will give empty items in the list)
 ε        # Map each string to:
  ć       #  Extract the head; pop and push the remainder and head separately to the stack
   u      #  Uppercase the head
    ì     #  Prepend it in front of the remainder again
     }ðý  # After the map: join by spaces (which is output implicitly as result)

Python 3, 59 bytes
print(*(w[0].upper()+w[1:]for w in input().split(' ')if w))

Try it online!

C - 85 Bytes
s[99]={32};j;main(i){for(;read(0,&j,1);)putchar(s[i++]=j<97|j>122|s[i-1]-32?j:j-32);}

Thanks to @ceilingcat because I saved 43 bytes with his modification.
Ungolfed
s[99] = {32};
j;

main(i)
{
   for( ; read(0, &j, 1); )

   putchar(s[i++] = j < 97 | j > 122 | s[i - 1] - 32 ?j :j - 32);
}

Explanation
A simple program that reads characters from the console and capitalizes each "valid" word and then displays it on the console as well. It was tested in GCC and it generates some warnings.

Vyxal s, 7 bytes
ðẆƛḣ$⇧p

Try it Online!
Fixed thanks to lyxal.
ðẆƛ     # Over each word...
   ḣ$ p # To the first character...
     ⇧  # Uppercase it

This doesn't preserve spaces, and doesn't output as a single string as required. Try it Online! to fix it for 7 bytes.

@lyxal We probably need to fix the S flag - this is kinda cursed. Thanks!

Lexurgy, 116 bytes
Simple replacement of lowercase letters at the beginning of a word to uppercase.
This works because of how Lexurgy handles whitespace in the input. The $ symbol denotes a word boundary, which is defined as any sort of whitespace before or after any character. As a result, input like hello world on a single line is considered as 2 words rather than 1 word.
a:
{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}=>{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z}/$ _

Japt -S, 7 bytes
¸®©hZÎu

Try it
¸®©hZÎu     :Implicit input of string
¸           :Split on spaces
 ®          :Map each Z
  ©         :  Logical AND with
   h        :  Replace first character with
    ZÎ      :    First character of Z
      u     :    Uppercased
            :Implicit output joined with spaces

Ruby: 46 characters
l=0
gets.chars{|c|l&&c.upcase!
l=c==" "
$><<c}

Sample run:
bash-4.3$ ruby -e 'l=0;gets.chars{|c|l&&c.upcase!;l=c==" ";$><<c}' <<< 'eCommerce rocks. crazyCamelCase stuff. _those  pigeon-toed shennanigans. Fiery trailblazing 345 thirty-two Roger. The quick brown fox jumped over the lazy dogs. Clancy Brown would have been cool as Lex Luthor. good_bye'
ECommerce Rocks. CrazyCamelCase Stuff. _those  Pigeon-toed Shennanigans. Fiery Trailblazing 345 Thirty-two Roger. The Quick Brown Fox Jumped Over The Lazy Dogs. Clancy Brown Would Have Been Cool As Lex Luthor. Good_bye

GNU sed, 20 + 1 (-r flag) +30 (regex penalty) = 51
s/(^| +)(.)/\1\u\2/g

(thks @manatwork for helping me save 4 bytes)
Usage :
sed 's/\(^\| \)\(.\)/\1\u\2/g' <<< "eCommerce and eBusiness are cool, don't you agree, Richard III?"

You have to add +30 penalty for using regular expression and +1 for the required -r option. By the way, no need to say [a-z] if you consume all spaces first: s/(^| +)(.)/\1\u\2/g

thanks -- Actually It seems (at last with GNU sed, that it dors not need the -r option)

Grr! I felt something is not optimal there since I first read this. s/^.| +./\U&/g

Your code has 20 bytes + 1 byte for a required r flag, so 21 without the regex penalty. It's not allowed to change the code when running it, which is what you did when adding all those escape slashes. The -r flag is given just for that purpose. Please correct the title and usage or I will downvote.

Almost there, the usage doesn't reflect the code. It should be sed -r 's/(^| +)(.)/\1\u\2/g' <<<.

thanks -- Actually It seems (at last with GNU sed), that it does not need the -r option

So I see usage still has a different code. I won't downvote as initially said, sorry for coming too strong at you last time.

PHP, 91+30 bytes
Well, all the ideas were used.
I had to resort to drastic measures and build a huge piece of code:
<?=preg_replace_callback('@( |^)([a-z])@',function($a){return$a[1].($a[2]^' ');},$_GET[s]);

The only function it uses is to fetch the small letters, using regex.

Your regular expression has a minor glitch. Should be @( |^)([a-z])@ as currently not processes the first word.

@manatwork GODDAMN! I deleted the wrong char. Thanks a lot for the tip. I've fixed it now. Initially I had @( |$|^)([a-z])@, which didn't made sense to have the |$ there, but deleted the very important |^ by mistake.

Why not ucwords?

@JörgHülsermann Because of https://codegolf.stackexchange.com/a/49980/14732 and because of rule #1.

C#, 143 138123 bytes
class G{static void Main(string[]a){var l=' ';foreach(var c in a[0]){System.Console.Write(l==' '?char.ToUpper(c):c);l=c;}}}

Runs as a command line util. Will try and golf it down from here. Comments & critique encouraged!

Instead of using ' ' you can use the ascii integer equivalent - 32 - which will save you two bytes :)

Groovy - 69
t=args[0];t.eachWithIndex{c,i->print!i|t[i-1]==' '?c.toUpperCase():c}

Ruby(55)
gets.chars.inject(' '){|c,d|print c<?!?d.upcase():d;d}

I know that a better ruby solution exits in an old answer, but I like this better.
note:c<?! checks for chars that come before !, which are just control/whitespace.

Rebol - 56 51
print map-each n split input" "[uppercase/part n 1]

The above works correctly with the test case and also with multiple whitespace input.
An interesting (but longer!) alternative version would to use the parse dialect (not a regex!) which when golfed would come down to 65 chars:
parse s: input [any [x: thru [" " | end] (uppercase/part x 1)]] print s

Java, 142
First post here as well, but found that the requirements are a one to one mapping to the way Java handles arguments.
class X{public static void main(String[]s){for(String p:s){System.out.append(p.toUpperCase().charAt(0)).append(p,1,p.length()).append(' ');}}}

Unfortunately, because they are command line arguments, spaces are not preserved, and the offending words (don't) have to be quoted ("don't"). So while I didn't entirely meet all the criteria I just wanted to share a Java solution that's under 200 bytes.

KDB(Q), 30 bytes
{@[x;0,1+where" "=-1_x;upper]}

Explanation
                  -1_x            / handle case where last char is space
       1+where" "=                / find index of space and shift by 1
     0,                           / include the first char
 @[x;                 ;upper]     / apply upper case
{                            }    / lambda

Test
q){@[x;0,1+where" "=-1_x;upper]}t
"ECommerce Rocks. CrazyCamelCase Stuff. _those  Pigeon-toed Shennanigans. Fiery Trailblazing 345 Thirty-two Roger. The Quick Brown Fox Jumped Over The Lazy Dogs. Clancy Brown Would Have Been Cool As Lex Luthor. Good_bye"

Jelly, 9 bytes
ṣ⁶Œu1¦€j⁶

Try it online!
How it works
ṣ⁶Œu1¦€j⁶  Main link. Argument: s (string)

ṣ⁶         Split s at spaces.
      €    Each; map this over the chunks:
    1¦       Apply this to the first character:
  Œu           Uppercase.
       j⁶  Join, separating by spaces.

It's non-competing anyways, so you could use K instead of j⁶.

s-lang, 8 bytes + 30 = 38
c![[^ ]*

s-lang
Procedure:

Capitalize the first letter of every range matched by the regex.

Any number of Every character not in Space.

VTL-2, 89 bytes
1 B=A
2 A=$
3 A=A-(32*(((B=0)+(B=32))*(A>97)*(A<123
4 $=8*(1-(A=4
5 $=B
6 #=1-(A=4

If I read the challenge right, input seems fairly flexible, so... This operates every time a character is input. Input is terminated by an EOT (CtrlD). Output is one character behind, so every time you input a character, the previous one will be output. This really confused my brain when I was entering the test case.
Line 1 is fairly obvious, it copies the value of B into A. It's fine to start the program from here because uninitialized variables are assumed to be 0. Line 2 takes a single character input from the terminal and assigns A to its ASCII value. Fairly straightforward so far. Line 3 is a bit of a doozy, but it translates to (keeping in mind that B is the previous character entered, and A is the character just entered) IF (B==NULL OR B==" ") AND (96 < A < 123) THEN A=A-32. Because $ echoes, line 4 inserts a backspace character so long as A isn't EOT. Line 5 prints B, and line 6 is akin to IF A!=EOT THEN GOTO 1.

JavaScript, 59 bytes
n=>n.split` `.map(e=>e[0].toUpperCase()+e.slice(1)).join` `

As I mentioned in some of my other answers, my solutions tend to be extremely boring and unimaginative.

Factor, 57 bytes
readln >words [ unclip ch>upper prefix ] map ""join write

Try it online!
Factor has a capitalize word, but for some reason it lowercases the rest of the word, so I couldn't use it.

Ly, 33 bytes
irs[:'`Gf'zG!fpl**[p' -0]p' =spo]

Try it online!
Pretty much a straight-forward application of the rules this time...
irs                               - read input, reverse, stash non-zero "capitalize?" state
   [                            ] - for each codepoint in the input...
    :                             - duplicate current char
     '`G                          - is it >="a"?
        f                         - pull current char forward
         'zG!                     - is it <="z"?
             fp                   - pull current char forward, delete it
               l                  - load "capitalize?" flag
                **                - multiply all three tests values
                  [p   0]p        - if/then, true if we need to capitalize
                    ' -           - sub 32 from codepoint to capitalize
                          ' =     - is the current char a space?
                             s    - save result as "capitalize?" flag
                              p   - delete test result
                               o  - print current codepoint as a char

Java, 167 bytes
public class G{public static void main(String[]e){for(String n:e[0].split(" ")){System.out.print(n.length()<1?"":n.substring(0,1).toUpperCase()+n.substring(1)+" ");}}}

Ungolfed:
public class G {
    public static void main(String[] e) {
        for (String n: e[0].split(" ")) {
            System.out.print(n.length() < 1 ? "" : n.substring(0, 1).toUpperCase() + n.substring(1) + " ");
        }
    }
}

You don't need braces for the For(), and I think substring(0,1) can be charAt(0).

The public modifier before the class definition can be removed.

JavaScript, (ES6 RegEx Replacer) 66 bytes

alert(prompt().replace(/(^[A-Z])|(\s[A-Z])/gi,m=>m.toUpperCase()))

Perl 6, 35 bytes
say slurp.split(" ")>>.tc.join(" ")

Try it online!

You can rempve the join and just stringify it instead. slurp can also be get since there won't be newlines. 24 bytes

C89 (clang), 60 58 bytes

-2 bytes thanks to @ceilingcat

c;main(a){read(0,&c,1)&&main(putchar(a?toupper(c):c)<33);}

This treats non-printable ASCII as spaces (including newlines and tabs), it could be fixed for +1 byte:
c;main(a){read(0,&c,1)&&main(putchar(a?toupper(c):c)==32);}

Try it online!

Thunno 2 Ṡ, 5 bytes
OıḢRƤ

Attempt This Online!
Explanation
OıḢRƤ  # Implicit input
O      # Split by spaces
 ı     # Map over this list:
  Ḣ    #  Head extract
   R   #  Uppercase
    Ƥ  #  Prepend
       # Implicit output, joined by spaces


text:
Convert a fraction to a repeated decimal
Almost the polar opposite if this challenge, and I suspect it will be slightly easier.
Your task is to take two integers in the format a/b (Forming a rational number) then output the number in decimal exactly.
For example, if you were to input 1/3, it would output:
0.33333333333333333

And would keep on printing 3s until the end of time, with an optional leading 0. (You could also print one character per line if and only if your language does not allow printing on the same line.)
The behaviour for x/0 will be undefined. For a number that looks like it doesn't repeat (Like, say 5/4) it actually does repeat. Either of the following two forms would be acceptable for 5/4:
1.25000000000000000
1.24999999999999999

(The same with whole numbers, 1.9999999 or 2.000000)
The fraction may not be in its simplest form, and a or b may be negative (Note -a/b = -(a/b), -a/-b = a/b, a/-b = -a/b, and -.6249999 is invalid, but -0.6249999 is acceptable, but you still can use.

Can we use Unix bc, or is that cheating?

Before I keep golfing my answer: Can a and/or b be negative?

@Dennis Yes, but either a or b (or both) can be negative)

@DavidRTribble I think that's a standard loophole, so no.

Does your latest edit say that leading zeroes are okay with positive numbers, but not negative ones? If so, what's the reason for that?

@Geobits No it says the opposite (.0, 0.0, -0.0 are all OK, but -.0 isn't as it looks weird.)

Right, that's what I meant, said it backward. So the reason is "it looks weird"? Okay...

Your last edit make some answer invalid (mine, above all). That should be avoided if possible.

CJam, 38 37 bytes
l'/%:i2*~*0<'-*o:Dmd\zo'.{oA*Dmd\z1}g

How it works
l     e# Read line from STDIN.            STACK '17/-13'
'/%   e# Split at '/'.                    STACK ['17' '-13']
:i    e# Cast each element to int.        STACK [17 -13]
2*~   e# Duplicate and dump the array.    STACK 17 -13 17 -13
*     e# Multiply.                        STACK 17 -13 -221
0<    e# Compare with zero.               STACK 17 -13 1
'-*o  e# Print '-' that many times.       STACK 17 -13
:D    e# Save the topmost integer in D.   STACK 17 -13
md    e# Perform modular division.        STACK -1 4
\z    e# Swap and take absolute value.    STACK 4 1
o'.   e# Print and push '.'.              STACK 4 '.'
{     e# do:
  o   e#   Print.                         STACK 4
  A*  e#   Multiply by 10.                STACK 40
  Dmd e#   Divide modulo D.               STACK -3 1
  \z  e#   Swap and take absolute value.  STACK 1 3
  o   e#   Print.                         STACK 1
1}g   e# while(1)

Since you use double division isn't this totally broken for big numbers?

@orlp: Totally. It's fixed now.

C, 108 79
Edit Modified to work with negative numbers.
Input from stdin. Old K&R style.
main(a,b){char*s="-%d.";scanf("%d/%d",&a,&b);for(a*b<0?(a<0?a=-a:(b=-b)):++s;printf(s,a/b);s="%d")a=a%b*10;}

Ruby, 83 69 102 91 89 bytes
->s{a,b=s.scan(/\d+/).map &:to_i
eval(s+?r)<0&&$><<?-
$><<a/b<<?.
loop{a=a%b*10
$><<a/b}}

Simple implementation of manual integer division based on the computer's integer division.
Thanks to @blutorange for the help in golfing.
Edit: Fixed the solution to include negative numbers.

By making use of some shortcuts in ruby, you can bring this down to 66 bytes: ->s{a,b=s.split(?/).map &:to_i;$><<a/b<<?.;loop{a=a%b*10;$><<a/b}} I just love this about ruby.

Wow, I just learned many things, thank you! I didn't remember about ?/ to denote characters, nor did I know about $><< to print or the loop keyword. Thanks a lot!!

You're welcome, I didn't know about many of these tricks either until somebody pointed it out. $> is short for $stdout, and << is an operator. You can save one more byte in the second line by changing it to c*d<0&&$><<?-; a few bytes by combining the 3rd/4th line to $><<a/b<<?., and one more by removing the space after << in the last line. And here's an idea to bring it down to 91 bytes: ->s{a,b=s.scan(/\d+/).map &:to_i;1==s.count(?-)&&$><<?-;$><<a/b<<?.;loop{a=a%b*10;$><<a/b}} (ruby 2.2.0)

The syntax for $><<a/b didn't work correctly, that's why I put the space there. The rest seems good, thank you very much!

That's interesting, perhaps the ruby version you're using doesn't like it without spaces? It works fine for me and at ideone. Funny enough, it breaks the syntax highlighting of my code editor, though...

Oh, maybe it works and I just assumed it didn't because of the syntax highlighting in vim... edit: after trying it, it works, it was the syntax highlighting that led me to believe it wouldn't

If you're still interested, there's also a rational literal (Rational(2,3) == 2/3r) since ruby 2.1 (that I learned about 10 mins ago) that can be used to shorten the second line: eval(s+?r)<0&&$><<?-

Thanks a lot! wow, ruby is really a complete language in many ways... And you are a true source of information!

Java, 177 176 170
s->{try{int x=new Integer(s.split("/")[0]),y=new Integer(s.split("/")[1]),z=1;for(;;x=x%y*10,Thread.sleep(999))System.out.print(x/y+(z-->0?".":""));}catch(Exception e){}}

The algorithm is straightforward; the tricky part was getting the printing to work. In the end, I had the computer sleep for a second between each step so it could print.
Expanded, runnable version
public class RepeatedDecimal {
    public static void main(String[] args) {
        java.util.function.Consumer<String> f = s -> {
                try {
                    int x = new Integer(s.split("/")[0]),
                        y = new Integer(s.split("/")[1]),
                        z = 1;
                    for (;; x = x % y * 10, Thread.sleep(999)) {
                        System.out.print(x / y + (z-- > 0 ? "." : ""));
                    }
                } catch (Exception e) { }
                };

        f.accept("5/7");
    }
}

While the output does have a flushing problem, I was able to get it to show output by sleeping for 9ms which would shave two bytes.

@Snowman It probably depends on the hardware or OS; my computer won't work with less than 250ms or so.

R, 103 137 109 103
Bit happier with this now.  Using scan with a separator save a lot of bytes.  May still have some room for improvement.
Replaced <- with =.  Haven't always had the best of luck with this, but it worked this time.
cat(if(prod(i=scan(sep='/'))<0)'-',(n=(i=abs(i))[1])%/%(d=i[2]),'.',sep='');repeat cat((n=n%%d*10)%/%d)

Test runs
> cat(if(prod(i=scan(sep='/'))<0)'-',(n=(i=abs(i))[1])%/%(d=i[2]),'.',sep='');repeat cat((n=n%%d*10)%/%d)
1: -1/3
3:
Read 2 items
-0.33333333333333333333...
> cat(if(prod(i=scan(sep='/'))<0)'-',(n=(i=abs(i))[1])%/%(d=i[2]),'.',sep='');repeat cat((n=n%%d*10)%/%d)
1: -5/-4
3:
Read 2 items
1.250000000000000000000...

Python 3, 107 115 bytes
a,b=map(int,input().split("/"))
print(("%.1f"%(a/b))[:-1],end="")
b=abs(b)
while 1:a=abs(a)%b*10;print(a//b,end="")

Pretty straightforward:

Input the numerator and denominator
Output the the quotient with 1 digit after the decimal point, then take off the last digit (e.g. -1/3 -> -0.)
Take absolute values*
Loop:

Numerator is remainder after dividing out denominator
Multiply numerator by 10
Output integer quotient as next digit

* (Though the calculation for a was moved inside the loop to save a few bytes.)
Edit: Fixed bug with negative fractions > -1.

Python 2.7, 209 bytes
from sys import*;m,o=1,lambda x:stdout.write(str(x));a,b=[int(x)for x in argv[1].split('/')]
o(str(a*b)[0]);a,b=abs(a),abs(b);o('0'*(b>a))
while 1:
 while not((m*a)/b):o('0.'[m==1]);m*=10
 o((m*a)/b);a=(m*a)%b

edit: Now outputs all characters on the same line, as asked.
edit2: Now reads the fraction from commandline argument, as requested :)

A few tips: 1) Using map instead of the list comprehension saves quite a bit; 2) don't need the parentheses around m*a in any of its locations, as *, %, and / are all the same precedence and left-associative; 3) the 0-or-dot logic on line 3 can be simplified to "0."[m==1], since you're just printing it anyway; 4) probably will save chars to merely set o=stdout.write and convert numeric arguments to string with backticks as needed.

Also, the code doesn't appear to work with negatives: 1/-3 gives -1.666666666 instead of -0.333333333.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Many programs, few characters
Your task is to create many programs. The first outputs 1, the second outputs 2, etc. The higher you can go, the better!
However, all of these programs must be made the same list of characters. You can choose which characters to put in the list. Each program can only use a character as many times as it appears in the list.
For example, using the Python shell:
List of characters:  +122
-------
Program 1:      1
Program 2:      2
Program 3:      1+2
Program 4:      2+2   (2 appears twice in the list)

It is impossible to make a program which prints 5 without reusing the + character, so there are a total of 4 programs possible with this list. (Only consecutive numbers starting from 1 count. We therefore ignore other numbers we can make, like 12.)
Scoring

Let N be the number of programs.
Let S be the size of the shortest program, or 15, whichever is less.
Let L be the length of the list.

Your score is N / Γ((L-S)/5), where Γ is the gamma function.
In the example above, N is 4; S is 1; L is 4; the score is 4 / Γ((4-1)/5) = 2.686.
Highest score wins!
Below is a Stack Snippet to help calculate your score:

var g=7,C=[0.99999999999980993,676.5203681218851,-1259.1392167224028,771.32342877765313,-176.61502916214059,12.507343278686905,-0.13857109526572012,9.9843695780195716e-6,1.5056327351493116e-7];function gamma(z) {if(z<0.5){return Math.PI/(Math.sin(Math.PI*z)*gamma(1-z));}else{z--;var x=C[0];for(var i=1;i<g+2;i++)x+=C[i]/(z+i);var t=z+g+0.5;return Math.sqrt(2*Math.PI)*Math.pow(t,(z+0.5))*Math.exp(-t)*x;}}function go(){var N=parseInt(jQuery('#programs').val()),S=parseInt(jQuery('#shortest').val()),L=parseInt(jQuery('#length').val());if(S>15){S=15;}jQuery('#score').val(N/gamma((L-S)/5));}
<form>

Number of programs:	<input id='programs' oninput="go()" value='0'/>

Size of shortest program:	<input id='shortest' oninput="go()" value='0'/>

Size of list:	<input id='length' oninput="go()" value='0'/>

Score:	<output id='score'>0</output>

</form>
Code from http://stackoverflow.com/a/15454784/3148067

Rules

You can use programs or functions.
You may use different languages for different numbers.
Each program must work by itself. For example, you can not assume that the first program will run before the second program.

So... if I have a single program of size 1, then I get a better score if my list is 8 long (score 1.127) as opposed to 1 (score 0)?

@Sp3000 Correct.

So we should arbitrarily pad programs and/or lists to get a better score? Just checking.

@Geobits The bonus for a long shortest program is to give languages other than CJam/Pyth to compete. And yes, if it helps your score.

What is that gamma function? checking wiki, it seems to be (n-1)! ? but that doesn't spit out 2.686 like your sample does?  Also - do CR/LFs count  for length ?

Do programs count if they are the same content as previous one but spit out different result? (ie same code spits out both 1 and 2 ?) or does the script itself have to differ slightly to count?

@Ditto Correct, the gamma function is like (n-1)! In the example, the score is 4 / gamma(3/5) = 2.686.

@Ditto For your second comment, how is that possible?

;) Not giving my secret away ... lol  (Also: you missed my CR/LF question)

@Ditto I think the general consensus is that a newline counts as one character.

Pyth, Score of 1.664 * 10^26
Since you only have L different chars to choose from, you can maximal generate O(L!) different programs.
So lets build something really close: By indexing permutations of the alphabet:
I use a following list of characters is:
abcdefghijklmnoppqrstuvwxxyzG."

With these characters I can generate 26!-1 different programs like this:
Program 1: x.pG"abcdefghijklmnopqrstuvwxzy
Program 2: x.pG"abcdefghijklmnopqrstuvwyxz
Program 3: x.pG"abcdefghijklmnopqrstuvwyzx
  ...
Program 403291461126605635583999999: x.pG"zyxwvutsrqponmlkjihgfedcba

Notice I didn't use "abcdefghijklmnopqrstuvwxyz" (sorted alphabet), since I give an index of 0.
So we got N = 403291461126605635583999999, S = 15, L = 31, which gives a score of 1.663767345141228e+26.
Explanation:
x.pG"...
   G       G is pre-initialized with "abc...xyz"
 .p        gives all possible permutations
x   "...   the index of "..." in the permutation list

Notice, that none of the programs will actually run. Because of memory and time.
edit:
You can even get way higher. For instance by using also the uppercase letters. Gives me a score of about 10^76.
edit 2: a runnable version
Since none of the programs above is actually runnable, here's one that works.
x.pSK""Kabcde

The programs are:
Program 1: x.pSK"abced"K
Program 2: x.pSK"abdce"K
Program 3: x.pSK"abdec"K
  ...
Program 117: x.pSK"edbca"K
Program 118: x.pSK"edcab"K
Program 119: x.pSK"edcba"K

Here's an online Demonstration.
Explanation:
x.pSK"abced"K
    K"abced"   K = "abced"
   S           sort it
 .p            generate all permutations of sorted(K)
x           K  index of K in the permutations.

N = 119, S = 13, L = 13 gives a score of 0. But If we simply use a dummy char to the list we get N = 119, S = 13, L = 14 and a score of 25.92
Of course we can use more chars than abcde for the permutation. If we use n different chars, we get N = n!-1, S = 15, L = n+8, which gives a score of ~n!/(n-7)!. So we can get pretty much an unlimited score.

We have a winner. Unless someone can get to a googol.

I recognize that you are allowed to create as a function, but this also seems to violate Each program must work by itself., as it requires another something to set up the array outside the function, and as such it's not entirely self contained. @Ypnypn, what is your take here?

@tfitzger Are you referring to the G variable? Because that's pre-initialized by the language, not by the user.

@Runer112 Edit 2 explicitly states that none of the prior code is runnable and then gives an example where an array appears to be populated before being run. The wording of this post, for someone who doesn't know  Pyth, makes it appear that they have to initialize the G variable, since it never explicitly states that G is a system variable. Thank you for the clarification.

Or if someone can get to a giggolplex, or a dossol, or n![999999999] using HAN, where n=99999!.

TI-84 BASIC, score 107.07
Character list (length 8): 12347+*^
Constructed programs:

1 = 1
2 = 2
3 = 3
4 = 4
5 = 2+3
6 = 2*3
7 = 7
8 = 2^3
9 = 3^2
10 = 7+3
11 = 7+4
12 = 12
13 = 13
14 = 14
15 = 2*7+1
16 = 2^4
17 = 17
18 = 2*7+4
19 = 2^4+3
20 = 14+2*3
21 = 3*7
22 = 3*7+1
23 = 23
24 = 24
25 = 24+1
26 = 2*13
27 = 27
28 = 4*7
29 = 1+4*7
30 = 2+4*7
31 = 31
32 = 32
33 = 32+1
34 = 34
35 = 34+1
36 = 34+2
37 = 37
38 = 37+1
39 = 37+2
40 = 12+4*7
41 = 41
42 = 42
43 = 43
44 = 43+1
45 = 43+2
46 = 32+14
47 = 47
48 = 47+1
49 = 7^2
50 = 7^2+1
51 = 3*17
52 = 4*13
53 = 3*17+2
54 = 4*13+2
55 = 3*17+4
56 = 7*2^3
57 = 7*2^3+1
58 = 37+21
59 = 42+17
60 = 43+17
61 = 37+24
62 = 31*2
63 = 7*3^2
64 = 4^3
65 = 4^3+1
66 = 4^3+2
67 = 7*3^2+4
68 = 4*17
69 = 27+14*3
70 = 43+27
71 = 71
72 = 72
73 = 73
74 = 74
75 = 74+1
76 = 74+2
77 = 74+3
78 = 2*37+4
79 = 47+32
80 = 7^2+31
81 = 3^4
82 = 3^4+1
83 = 3^4+2
84 = 7*12
85 = 4^3+21
86 = 2*43
87 = 7*12+3
88 = 7*12+4
89 = 73+2^4
90 =  7^2+41
91 = 7*13
92 = 7^2+43
93 = 7*13+2
94 = 2*47
95 = 7*13+4

CJam, 101023.64023653832850 > 10 400 000 000 000 000 000 000 000
Characters
Each program consists of 9 + 63 486 × 1020 characters:

""_e!\a#)
1020 copies of all Unicode characters in the range 0 – 65 535, except "\ and surrogates.

Programs
The structure of each program is:
"…"_e!\a#)

where … denotes a permutation of all 63 486 aforementioned Unicode characters.
_e! computes all possible permutations of the characters in sorted order.
\a# computes the index of the original permutation in the list of all of them. ) adds 1 to that index to generate only positive integers.
Scoring
If the 1020 copies of each of the 63 486 characters were somehow different, there would be a total of (63 486 × 1020)! different ways to arrange them.
However, for each of the 63 486 characters, this generates 1020! identical permutations, since this is the number of ways the copy of this single character can be arranged.
Therefore, the number of different permutations is (63 486 × 1020)! / (1020!)63 486.
Plugging this number and the character count into WolframAlpha reveals the score from the top.
Bonus
Of course, enumerating all possible permutations isn't very efficient and even storing 6 × 1024 characters isn't possible on my computer.
Using the online interpreter and more efficient code, I can permute one copy of 1 000 characters in a few seconds for a score of 3 × 102 189.
The highest number it produces is generated by the following code:
"㢣㢢㢡㢠㢟㢞㢝㢜㢛㢚㢙㢘㢗㢖㢕㢔㢓㢒㢑㢐㢏㢎㢍㢌㢋㢊㢉㢈㢇㢆㢅㢄㢃㢂㢁㢀㡿㡾㡽㡼㡻㡺㡹㡸㡷㡶㡵㡴㡳㡲㡱㡰㡯㡮㡭㡬㡫㡪㡩㡨㡧㡦㡥㡤㡣㡢㡡㡠㡟㡞㡝㡜㡛㡚㡙㡘㡗㡖㡕㡔㡓㡒㡑㡐㡏㡎㡍㡌㡋㡊㡉㡈㡇㡆㡅㡄㡃㡂㡁㡀㠿㠾㠽㠼㠻㠺㠹㠸㠷㠶㠵㠴㠳㠲㠱㠰㠯㠮㠭㠬㠫㠪㠩㠨㠧㠦㠥㠤㠣㠢㠡㠠㠟㠞㠝㠜㠛㠚㠙㠘㠗㠖㠕㠔㠓㠒㠑㠐㠏㠎㠍㠌㠋㠊㠉㠈㠇㠆㠅㠄㠃㠂㠁㠀㟿㟾㟽㟼㟻㟺㟹㟸㟷㟶㟵㟴㟳㟲㟱㟰㟯㟮㟭㟬㟫㟪㟩㟨㟧㟦㟥㟤㟣㟢㟡㟠㟟㟞㟝㟜㟛㟚㟙㟘㟗㟖㟕㟔㟓㟒㟑㟐㟏㟎㟍㟌㟋㟊㟉㟈㟇㟆㟅㟄㟃㟂㟁㟀㞿㞾㞽㞼㞻㞺㞹㞸㞷㞶㞵㞴㞳㞲㞱㞰㞯㞮㞭㞬㞫㞪㞩㞨㞧㞦㞥㞤㞣㞢㞡㞠㞟㞞㞝㞜㞛㞚㞙㞘㞗㞖㞕㞔㞓㞒㞑㞐㞏㞎㞍㞌㞋㞊㞉㞈㞇㞆㞅㞄㞃㞂㞁㞀㝿㝾㝽㝼㝻㝺㝹㝸㝷㝶㝵㝴㝳㝲㝱㝰㝯㝮㝭㝬㝫㝪㝩㝨㝧㝦㝥㝤㝣㝢㝡㝠㝟㝞㝝㝜㝛㝚㝙㝘㝗㝖㝕㝔㝓㝒㝑㝐㝏㝎㝍㝌㝋㝊㝉㝈㝇㝆㝅㝄㝃㝂㝁㝀㜿㜾㜽㜼㜻㜺㜹㜸㜷㜶㜵㜴㜳㜲㜱㜰㜯㜮㜭㜬㜫㜪㜩㜨㜧㜦㜥㜤㜣㜢㜡㜠㜟㜞㜝㜜㜛㜚㜙㜘㜗㜖㜕㜔㜓㜒㜑㜐㜏㜎㜍㜌㜋㜊㜉㜈㜇㜆㜅㜄㜃㜂㜁㜀㛿㛾㛽㛼㛻㛺㛹㛸㛷㛶㛵㛴㛳㛲㛱㛰㛯㛮㛭㛬㛫㛪㛩㛨㛧㛦㛥㛤㛣㛢㛡㛠㛟㛞㛝㛜㛛㛚㛙㛘㛗㛖㛕㛔㛓㛒㛑㛐㛏㛎㛍㛌㛋㛊㛉㛈㛇㛆㛅㛄㛃㛂㛁㛀㚿㚾㚽㚼㚻㚺㚹㚸㚷㚶㚵㚴㚳㚲㚱㚰㚯㚮㚭㚬㚫㚪㚩㚨㚧㚦㚥㚤㚣㚢㚡㚠㚟㚞㚝㚜㚛㚚㚙㚘㚗㚖㚕㚔㚓㚒㚑㚐㚏㚎㚍㚌㚋㚊㚉㚈㚇㚆㚅㚄㚃㚂㚁㚀㙿㙾㙽㙼㙻㙺㙹㙸㙷㙶㙵㙴㙳㙲㙱㙰㙯㙮㙭㙬㙫㙪㙩㙨㙧㙦㙥㙤㙣㙢㙡㙠㙟㙞㙝㙜㙛㙚㙙㙘㙗㙖㙕㙔㙓㙒㙑㙐㙏㙎㙍㙌㙋㙊㙉㙈㙇㙆㙅㙄㙃㙂㙁㙀㘿㘾㘽㘼㘻㘺㘹㘸㘷㘶㘵㘴㘳㘲㘱㘰㘯㘮㘭㘬㘫㘪㘩㘨㘧㘦㘥㘤㘣㘢㘡㘠㘟㘞㘝㘜㘛㘚㘙㘘㘗㘖㘕㘔㘓㘒㘑㘐㘏㘎㘍㘌㘋㘊㘉㘈㘇㘆㘅㘄㘃㘂㘁㘀㗿㗾㗽㗼㗻㗺㗹㗸㗷㗶㗵㗴㗳㗲㗱㗰㗯㗮㗭㗬㗫㗪㗩㗨㗧㗦㗥㗤㗣㗢㗡㗠㗟㗞㗝㗜㗛㗚㗙㗘㗗㗖㗕㗔㗓㗒㗑㗐㗏㗎㗍㗌㗋㗊㗉㗈㗇㗆㗅㗄㗃㗂㗁㗀㖿㖾㖽㖼㖻㖺㖹㖸㖷㖶㖵㖴㖳㖲㖱㖰㖯㖮㖭㖬㖫㖪㖩㖨㖧㖦㖥㖤㖣㖢㖡㖠㖟㖞㖝㖜㖛㖚㖙㖘㖗㖖㖕㖔㖓㖒㖑㖐㖏㖎㖍㖌㖋㖊㖉㖈㖇㖆㖅㖄㖃㖂㖁㖀㕿㕾㕽㕼㕻㕺㕹㕸㕷㕶㕵㕴㕳㕲㕱㕰㕯㕮㕭㕬㕫㕪㕩㕨㕧㕦㕥㕤㕣㕢㕡㕠㕟㕞㕝㕜㕛㕚㕙㕘㕗㕖㕕㕔㕓㕒㕑㕐㕏㕎㕍㕌㕋㕊㕉㕈㕇㕆㕅㕄㕃㕂㕁㕀㔿㔾㔽㔼㔻㔺㔹㔸㔷㔶㔵㔴㔳㔲㔱㔰㔯㔮㔭㔬㔫㔪㔩㔨㔧㔦㔥㔤㔣㔢㔡㔠㔟㔞㔝㔜㔛㔚㔙㔘㔗㔖㔕㔔㔓㔒㔑㔐㔏㔎㔍㔌㔋㔊㔉㔈㔇㔆㔅㔄㔃㔂㔁㔀㓿㓾㓽㓼㓻㓺㓹㓸㓷㓶㓵㓴㓳㓲㓱㓰㓯㓮㓭㓬㓫㓪㓩㓨㓧㓦㓥㓤㓣㓢㓡㓠㓟㓞㓝㓜㓛㓚㓙㓘㓗㓖㓕㓔㓓㓒㓑㓐㓏㓎㓍㓌㓋㓊㓉㓈㓇㓆㓅㓄㓃㓂㓁㓀㒿㒾㒽㒼"_${\(_3$#2$,m!*X+:X;@^}hX

Copying and pasting the code from above should work just fine.
Using the Java interpreter, I can use one copy of all 63 486 characters and execute the code in under five and a half hours:
$ cjam <(echo '65536,2048,55296f+-:c"\"\\"-W%`"_${\(_3$#2$,m!*X+:X;@^}hX"') > test.cjam
$
$ time test.cjam > /dev/null

real    324m36.040s
user    331m55.488s
sys     0m54.971s

This method achieves a score of 7.6 × 10230 732.

(redone as previous was loophole - sorry about that).
(edited to fix score: N=8, due to gaps - forgot about that)
Unix/Korn Shell  (Score: 9.016)
(going a very simple method, just trying to maximize the Gamma function)
List is: (L=13)
 echo 12345678

8 Programs:
  echo 1
  echo 2
  ...
  echo 8

so:
  N=8
  S=6
  L=13

Hopefully no loopholes this time around - I just crunched the formula and figured out where to maximize it.
For my method, it maximized at S=6 and L=13.
:)
Wolfram Alpha tells me:
8 / Γ((13-6)/5) = 9.016

This is a standard loophole: http://meta.codegolf.stackexchange.com/a/1789/16294

Ok .. reworked it .. hopefully no loop holes this time ?

You have to print all numbers from 1 to N. With your list, you can't print 11.

Yeah, just noticed that as well :) lol ... tricky .. (oh well, going to leave this her and let it sink ... sigh ... ) :)

It's considered good manners around here to delete invalid answers, and undelete them once they are fixed. That will also help you avoid unnecessary downvotes.

Ok - I'll leave it up and fix it, as sleeping on it, I realized it's still valid up to N=8 .. :) not great, but still a score :) (Still new to code golf and learning all the nuances ;) )

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Express a number - a modern "Des Chiffres et des Lettres"
Express a number
Back in the 60s, the French invented the TV game show "Des Chiffres et des Lettres" (Digits & Letters). The goal of the Digits-part of the show was to come as close as you can to a certain 3-digit target number, using some semi-randomly selected numbers. The contestants could use the following operators:

concatenation (1 and 2 is 12)
addition (1 + 2 is 3)
subtraction (5 - 3 = 2)
division (8 / 2 = 4); division is only allowed if the result is a natural number
multiplication (2 * 3 = 6)
parentheses, to override the regular precedence of operations: 2 * ( 3 + 4 ) = 14

Each given number can only be used once or not at all.
For example, the target number 728 can be matched exactly with the numbers: 6, 10, 25, 75, 5 and 50 with the following expression:
75 * 10 - ( ( 6 + 5 ) * ( 50 / 25 ) ) = 750 - ( 11 * 2 ) = 750 - 22 = 728

In this code challenge, your are given the task to find an expression as close as possible to a certain target number. Since we're living in the 21st century, we'll introduce bigger target numbers and more numbers to work with than back in the 60s.
Rules

Allowed operators: concatenation, +, -, /, *, ( and )
The concatenation operator has no symbol. Just concatenate the numbers.
There is no "inverse concatenation". 69 is 69 and can't be split in a 6 and a 9.
The target number is a positive integer and has a maximum of 18 digits.
There are at least two numbers to work with and a maximum of 99 numbers. These numbers are also positive integers with a maximum of 18 digits.
It is possible (actually quite probably) that the target number can't be expressed in terms of the numbers and the operators. The goal is to get as close as possible.
The program should finish in a reasonable time (a few minutes on a modern desktop PC).
Standard loopholes apply.
Your program may not be optimized for the test set in the "scoring" section of this puzzle. I reserve the right to change the test set if I suspect anyone violating this rule.
This is not a codegolf.

Input
The input consists of an array of numbers that can be formatted in any convenient way. The first number is the target number. The rest of the numbers are the numbers you should work with to form the target number.
Output
The requirements for the output are:

It should be a string that consists of:

any subset of the input numbers (except the target number)
any number of operators

I prefer the output to be single line without spaces, but if you must, you may add spaces and newlines as you see fit. They will be ignored in the controlling program.
The output should be a valid mathematical expression.

Examples
For readability, all these examples have an exact solution and each input number is used exactly once.
Input: 1515483, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Output: 111*111*(111+11+1)
Input: 153135, 1, 2, 3, 4, 5, 6, 7, 8, 9
Output: 123*(456+789)
Input: 8888888888, 9, 9, 9, 99, 99, 99, 999, 999, 999, 9999, 9999, 9999, 99999, 99999, 99999, 1
Output: 9*99*999*9999-9999999-999999-99999-99999-99999-9999-999-9-1
Input: 207901, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0
Output: 1+2*(3+4)*(5+6)*(7+8)*90
Input: 34943, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0
Output: 1+2*(3+4*(5+6*(7+8*90)))
But also valid output is: 34957-6-8
Scoring
The penalty score of a program is the sum of the relative errors of the expressions for the testset below.

For example if the target value is 125 and your expression gives 120, your penalty score is abs( 1 - 120/125 ) = 0,04.
The program with the lowest score (lowest total relative error) wins. If two programs finish equally, the first submission wins.
Finally, the testset (8 cases):
14142, 10, 11, 12, 13, 14, 15
48077691, 6, 9, 66, 69, 666, 669, 696, 699, 966, 969, 996, 999
333723173, 3, 3, 3, 33, 333, 3333, 33333, 333333, 3333333, 33333333, 333333333
589637567, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
8067171096, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199
78649377055, 0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132, 156, 182, 210, 240, 272, 306, 342, 380, 420, 462, 506, 552, 600, 650, 702, 756, 812, 870, 930, 992
792787123866, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 1346269, 2178309, 3524578, 5702887, 9227465, 14930352, 24157817, 39088169
2423473942768, 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 2000000, 5000000, 10000000, 20000000, 50000000

Previous similar puzzles
After creating this puzzle and posting it on the sandbox, I noticed something similar (but not the same!) in two previous puzzles: here (no solutions) and here. This puzzle is somewhat different, because it introduces the concatenation operator, I don't seek and exact match and I like to see strategies for coming close to the solution without brute force. I think it is challenging.

Can you concatenate the results of other operators? For example, 21 = (1 + 1) 1.

Wow. Good question. Didn't think of that one. My first response was "no way; that's not how I intended it." But it is so reasonable. And concatenation wouldn't be much of an operator if this wasn't possible. So... Yes! It's possible. Put parentheses around an expression, put another expression or number next to it and there's the concatenation. So (1+1)(1+1) is 22. I'll adjust the question accordingly.

I used to look at that show when I was a kid and I am pretty sure there wasn't the concatenation operator. Well, maybe the rules have changed since it was in 90s...

Probably you're right. I wasn't sure about that. But it makes the puzzle more interesting...

I confirm that the concatenation doesn't exist or is a recent addition, but I just love it - makes the challenge so much more interesting!

C++17, score .0086
This program has non-deterministic penalty score due to thread races, so I'm declaring based on an average of three runs, each of which handled the test suite in under a minute:
score 0.000071 for 14(11*13) = 14143
score 0.000019 for (696699+66)*69 = 48076785
score 0.000069 for 333333+333333333+33333 = 333699999
score 0.000975 for 5(1((((555555255-1-1-4-5-5-5-5-4-4-4-4-4-4-4-4-4-4-4-4-4-5-3-3-3-3-3-3-3-3-3-3-3-3-3-5)/2*3/2-2)/2*3+2+1+1+1+1-1-1)/2*2/2/2/2)/2) = 589062470
score 0.000462 for (((199181197*41-193-191-179-173-167-163-157-151-149-139-137-131-127-113-109-107-103-101-97-89-83-79-73-71-67-61-59-53-47-43-17-3)/5*7+23)/2/11*13+19)/31*37 = 8063447296
score 0.000118 for (992930870*72+812+756+702+650+600+552+506+462+420+380+342-42-56-182-12-210-156-90-20-272-30-6-306)/240*132*2 = 78640130184
score 0.000512 for (((317811*832040*3-39088169-24157817-14930352-9227465-5702887-2178309-1346269-3524578-514229-196418-121393-17711-233-75025-46368-89-28657-4181-10946-6765-34-987-2584-13-610-8-1)/2-377-144)/5-1597)1 = 793193194211
score 0.005725 for 2(20((120000000*20000+50000000+10000000+5000000+2000000+100000+50000+10000+5000+2000-500-1000)/50)/5)+200+100+10 = 2409600268972
total score = .007951

real    0m57.876s
user    4m24.396s
sys     0m0.684s

score 0.000071 for 14(11*13) = 14143
score 0.000019 for (696699+66)*69 = 48076785
score 0.000069 for 333333+333333333+33333 = 333699999
score 0.001675 for (3((((((((555555455+5+5+5+5-1-1-4-4-4-4-4-4-4-4-4-1-4-4-4-4-5-3-3-3-3-3-4)/2*3/2-1)*2+5)/3*3+3)/2-3-3)/2*3/2*2+2)/2*2/2*3+2+1)/5/2)-1-1-1-1-1-1-1-1-1-2)/2*3 = 590624943
score 0.000973 for ((199181197*41-193-191-179-173-167-163-157-151-149-139-137-131-127-113-107-101-59-97-79-3-71-67-83-2-47-37-73-89-103-19-11-29)/5*7+109-23)/61*43 = 8059325224
score 0.000118 for ((992930870*72+812+756+702+650+600+552+506+462+420+380+342+306+272+240+210+182-0-56-110-20-90)/2-42-156)/30*132/12*6 = 78640132296
score 0.000512 for (((317811*832040*3-39088169-24157817-14930352-9227465-5702887-3524578-514229-196418-2178309-1346269-121393-75025-28657-10946-233-46368-89-17711-2584-6765-610-4181-34-987-55-1)/2-8-144-377)/5-1597)1 = 793193194161
score 0.004734 for 2(20((120000000*20000+50000000+10000000+5000000+2000000+100000+50000+10000+5000+2000-100-1000-500)/200*50/10)/5) = 2412000335827
total score = .008171

real    0m45.636s
user    3m30.272s
sys     0m0.720s

score 0.000071 for 14(11*13) = 14143
score 0.000019 for (696699+66)*69 = 48076785
score 0.000069 for 333333+333333333+33333 = 333699999
score 0.002963 for 1(((((((555555555+5+5+5+5+5+5+4+4+4+4-1-2-4-4-4-4-4-4-4-4-4-4-4-3-3-3-3)/2*3+3+2)/2*2+3+3)/2*2/2/2*3+3)/2-3-3)*3/2-1-3)/2*3/2/2)/2 = 587890622
score 0.000069 for ((((199181197*41-193-191-179-173-167-163-157-151-149-139-137-131-127-113-109-107-103-101-97-89-83-79-73-71-67-61-59-53-47-43-37-11)/7)2+3)/23*17-13-5)/31*29 = 8066615553
score 0.000118 for ((992930870*72+812+756+702+650+600+552+506+462+420+380-0-6-90-56-42-272-182-110-210-342-30-306)*2+12)/240*132 = 78640129524
score 0.000512 for (((317811*832040*3-39088169-24157817-14930352-9227465-5702887-2178309-1346269-3524578-514229-196418-121393-75025-46368-28657-144-55-17711-2584-10946-4181-6765-21-610-987-377-8-1)/2-89-13)/5-233-1597)1 = 793193192491
score 0.005725 for 2(20((120000000*20000+50000000+10000000+5000000+2000000+100000+50000+10000+5000+2000-500-1000)/50)/5)+200+100+10 = 2409600268972
total score = .009546

real    0m57.289s
user    4m19.488s
sys     0m0.708s

Here's the program; explanation is provided in comments.  You can define CONCAT_NONE for traditional Countdown rules that don't permit concatenation, or CONCAT_DIGITS to allow concatenation of the input values, but not of any intermediate results.  By default, without either defined, the most liberal rules are used.
#include <omp.h>

#include <algorithm>
#include <cmath>
#include <memory>
#include <set>
#include <string>
#include <utility>
#include <vector>

// We apply some principles to help us arrive at a good enough solution
// in a reasonable time:

// 1. Ruthlessly prune duplicate expressions from the candidate
//    list.  If we've seen a+b, then there's no need to consider
//    b+a.  Similarly, having seen (a+b)+c, then (a+c)+b can be
//    discounted.
// 2. Detect duplicates by storing batches of part-processed results
//    in sets before sending to the next pass.
// 3. Sort our candidates so that those containing a term near to the
//    target are first in line for further processing.
// 4. Gradually widen our acceptance margin as we proceed.  This
//    allows us to terminate quickly without exhaustively searching
//    the full problem space.
// 5. Parallelize the generation of candidate solutions using OpenMP.

// Define precedence values for our operators, so that we can print
// with the minimum sufficient parentheses.  The values are grouped
// into tens so that add/10 == subtract/10 and mult/10 == divide/10 -
// the operators use that for avoiding duplicate expressions.
static const int PREC_ADD = 26;
static const int PREC_SUBTRACT = 24;
static const int PREC_MULT = 16;
static const int PREC_DIVIDE = 14;
static const int PREC_CONCAT = 2;
static const int PREC_LITERAL = 0;

static const int PREC_MAX = 1000;

class LiteralTerm;

struct Term
{
    long value;
    int precedence;

    Term(long value, int precedence)
        : value(value), precedence(precedence)
    {}
    Term(const Term&) = default;
    virtual ~Term() = default;

    virtual std::string to_string(int p = PREC_MAX) const = 0;
    virtual LiteralTerm as_literal() const = 0;

    long distance(long target) const { return std::abs(value - target); }

    // We sort large values first, in the hope that this will approach
    // the target faster.
    bool operator<(const Term& o) const { return value > o.value; }
};

// We have two kinds of Term: a LiteralTerm is a leaf node of the
// expression tree, and a BinaryTerm is an internal node.
struct Operator;

class LiteralTerm : public Term
{
    std::string s;
public:
    LiteralTerm(std::string s) : Term(std::stol(s), 0), s(s) {}
    LiteralTerm(std::string s, long value) : Term(value, 0), s(s) {}
    std::string to_string(int = PREC_MAX) const override { return s; }
    LiteralTerm as_literal() const override { return *this; }
};

struct BinaryTerm : public Term
{
    Operator const *op;

    std::shared_ptr<const Term> a;
    std::shared_ptr<const Term> b;

    BinaryTerm(long value, const Operator* op, std::shared_ptr<const Term> a, std::shared_ptr<const Term> b);
    BinaryTerm(const BinaryTerm&) = default;
    BinaryTerm& operator=(const BinaryTerm&) = default;

    std::string to_string(int p = PREC_MAX) const;

    LiteralTerm as_literal() const override { return { to_string(), value }; }
};

struct TermList {
    std::vector<std::shared_ptr<const Term>> terms;
    std::vector<long> values;
    long target_value;
    long badness;

    TermList(std::vector<std::shared_ptr<const Term>> terms, long target_value)
        : terms(std::move(terms)),
          values(),
          target_value(target_value),
          badness(min_badness(this->terms, target_value))
    {
        values.reserve(terms.size());
        std::transform(terms.begin(), terms.end(),
                       std::back_inserter(values), [](auto t) { return t->value; });
        // Literals that begin with "0" need to be distinct from (but
        // adjacent to) equivalent non-literals.  Append a negative
        // value for each term with leading zeros.  There's an edge
        // case involving multiple leading zeros, but we'll ignore
        // that.
        for (const auto& v: terms)
            if (v->precedence <= PREC_CONCAT && v->value > 0 && v->to_string()[0] == '0')
                values.push_back(-v->value);
    }

    // Sort according to the term that's nearest to the target.
    bool operator<(const TermList& o) const
    {
        return std::make_tuple(std::cref(badness),   std::cref(values))
            <  std::make_tuple(std::cref(o.badness), std::cref(o.values));
    }

private:
    static long min_badness(const std::vector<std::shared_ptr<const Term>>& t, long target_value)
    {
        auto less_bad = [target_value](const auto& a, const auto&b)
            { return a->distance(target_value) < b->distance(target_value); };
        auto const& e = *std::min_element(t.begin(), t.end(), less_bad);
        return std::abs(e->value - target_value);
    }
};

using Set = std::set<TermList>;

// Detect duplicate expressions.  This will discount "3+2-3", "8*5*2/3/5"
// and similar expressions that contain simple pairs of inverse operands.
static bool contains_value(const Term& t, int precedence, long value)
{
    auto *const b = dynamic_cast<const BinaryTerm*>(&t);
    if (t.precedence == precedence)
        return t.value == value
            || b && b->b->value < value
            || b && contains_value(*b->a, precedence, value)
            || b && contains_value(*b->b, precedence, value);
    if (t.precedence/10 == precedence/10)
        // Advance through the subtractions to inspect the additions
        // (or through the divides to inspect the multiplications).
        return b && contains_value(*b->a, precedence, value);
    return false;
}

// An Operator is a factory producing binary terms of a given type,
// and for printing those terms.  Here's the abstract base class.
struct Operator
{
    using TermPointer = std::shared_ptr<const Term>;
    using BinaryTermPointer = std::shared_ptr<const BinaryTerm>;

    int const precedence;
    std::string const joiner;

    virtual std::string to_string(const Term &a, const Term &b) const {
        return a.to_string(precedence) + joiner + b.to_string(precedence);
    }

    virtual BinaryTermPointer make_term(TermPointer a, TermPointer b) const {
        long r = evaluate(*a, *b);
        return r ? std::make_shared<BinaryTerm>(r, this, a, b) : BinaryTermPointer();
    }

    virtual ~Operator() = default;

protected:
    Operator(int precedence, std::string joiner) : precedence(precedence), joiner(joiner) {}

    virtual long evaluate(const Term& a, const Term& b) const = 0;
};

// Now we define a subclass for each permitted operator
struct AddOperator : Operator
{
    AddOperator() : Operator(PREC_ADD, "+") {}

    long evaluate(const Term& a, const Term& b) const override
    {
        const auto *d = dynamic_cast<const BinaryTerm*>(&a);
        long r;
        return b.precedence/10 != PREC_ADD/10
            && a.precedence != PREC_SUBTRACT
            && b.value > 0
            && ! (d && d->precedence == this->precedence && d->b->value < b.value)
            && !__builtin_add_overflow(a.value, b.value, &r)
            ? r : 0;
    }
};
struct SubtractOperator : Operator
{
    SubtractOperator() : Operator(PREC_SUBTRACT, "-") {}

    long evaluate(const Term& a, const Term& b) const override
    {
        return b.precedence < PREC_SUBTRACT
            && a.value > b.value
            && !contains_value(a, PREC_ADD, b.value)
            ? a.value - b.value : 0;
    }
};
struct MultiplyOperator : Operator
{
    MultiplyOperator() : Operator(PREC_MULT, "*") {}

    long evaluate(const Term& a, const Term& b) const override
    {
        const auto *d = dynamic_cast<const BinaryTerm*>(&a);
        long r;
        return b.precedence/10 != PREC_MULT/10
            && b.value > 1
            && (b.value > 2 || a.value > 2)
            && ! (d && d->precedence == this->precedence && d->b->value < b.value)
            && !__builtin_mul_overflow(a.value, b.value, &r)
            ? r : 0;
    }
};
struct DivideOperator : Operator
{
    DivideOperator() : Operator(PREC_DIVIDE, "/") {}

    long evaluate(const Term& a, const Term& b) const override
    {
        return b.precedence/10 != PREC_DIVIDE/10 && b.value > 1
            && a.value % b.value == 0
            && !contains_value(a, PREC_MULT, b.value)
            ? a.value / b.value : 0;
    }
};

struct ConcatOperator : Operator
{
    ConcatOperator() : Operator(PREC_CONCAT, "") {}

    long evaluate(const Term& a, const Term& b) const override
    {
#ifdef CONCAT_DIGITS
        if (a.precedence > PREC_CONCAT || a.value == 0 || b.precedence >= PREC_CONCAT)
            return 0;
#else  // CONCAT_FULL
        if (b.precedence == PREC_CONCAT || a.value == 0)
            return 0;
#endif
        long bv = b.value, av = a.value, x = 1, r;
        if (b.precedence > PREC_CONCAT) while (x <= bv) x*= 10;
        else { int d = b.to_string().length(); while (d--) x*= 10; }
        return __builtin_mul_overflow(av, x, &r) || __builtin_add_overflow(r, bv, &r) ? 0 : r;
    }
};
struct ReverseConcatOperator : ConcatOperator
{
    BinaryTermPointer make_term(TermPointer a, TermPointer b) const override
    {
        return ConcatOperator::make_term(b, a);
    }
};

static const std::vector<std::shared_ptr<const Operator>> ops{
#ifndef CONCAT_NONE
        std::make_shared<ConcatOperator>(),
        std::make_shared<ReverseConcatOperator>(),
#endif
        std::make_shared<MultiplyOperator>(),
        std::make_shared<AddOperator>(),
        std::make_shared<SubtractOperator>(),
        std::make_shared<DivideOperator>(),
};

// Implement the BinaryTerm members that use Operator
BinaryTerm::BinaryTerm(long value, const Operator* op, std::shared_ptr<const Term> a, std::shared_ptr<const Term> b)
    : Term(value, op->precedence), op(op), a(std::move(a)), b(std::move(b))
{}

std::string BinaryTerm::to_string(int p) const
{
    auto const s = op->to_string(*a, *b);
    return (p/10) < (precedence/10) ? "("+s+")" : s;
}

// An object to represent our target value, and how close we have
// reached so far.
struct Target
{
    const long value;
    double max_badness = 0;

    LiteralTerm best = {"0"};
    long best_badness = value;

    bool done() const { return best_badness < max_badness; }
    double score() const { return 1.*best_badness/value; }

    void update(const Term& t)
    {
        auto badness = std::abs(t.value - value);
        if (badness < best_badness) {
            best = t.as_literal();
            best_badness = badness;
        }
    }

    void update(const TermList& terms)
    {
        for (auto t: terms.terms)
            update(*t);
    }

    void increase_threshold(size_t items_seen)
    {
        // Adjust our acceptance threshold nearer to accepting 0 by
        // 0.01% for every million values seen.
        max_badness += (value - max_badness) * .0001 * std::exp(items_seen / 1000000);
    }
};

// OpenMP reduction for sets
auto merge(auto& a, auto& b)
{
    auto it = a.begin();
    for (auto&& e: b)
        it = a.insert(std::move(e)).first;
    return a;
}
#pragma omp declare reduction(merge: Set: merge<Set>(omp_out, omp_in) ) \
    initializer(omp_priv = Set())

// We run a cascade of pair-wise combination steps, where for each
// input TermList, we generate every possible allowed pairing of its
// terms, and pass that through (in batches) to the next stage.
struct Combiner
{
    std::unique_ptr<Combiner> const next;
    Target& target;
    size_t const max_output_size;
    size_t const nterms;

    Set input = {};
    size_t output_size = 0;

    Combiner(Target& target, size_t nterms, size_t max_output_size)
        : next(nterms > 0 ? std::make_unique<Combiner>(target, nterms-1, max_output_size) : nullptr),
          target(target),
          max_output_size(max_output_size),
          nterms(nterms)
    {}

    inline void insert(const TermList&& t)
    {
        target.update(t);
        if (target.done()) return;
        if (next) {
            if (input.insert(t).second)
                output_size += count_distinct_pairs(t);
            if (output_size >= max_output_size)
                process_input();
        }
    }

    void finish()
    {
        process_input();
        if (next)
            next->finish();
    }

private:
    // Here's where we do the real work - generating and sifting the
    // combined terms for the next pass.
    void process_input()
    {
        if (target.done()) {
            return;
        }

        if (!next)
            return;

        // Move the elements into a vector, so we can parallelize the
        // for-loop.
        auto in = std::vector<Set::value_type>();
        in.reserve(input.size());
        std::move(input.begin(), input.end(), std::back_inserter(in));
        input.clear();
        output_size = 0;

        auto out = Set();

#pragma omp parallel reduction(merge:out)
        {
#pragma omp for
            for (auto it = in.begin();  it < in.end();  ++it)
            {
                try {
                    const auto end = it->terms.cend();
                    for (auto i = it->terms.cbegin();  i != end;  i = std::upper_bound(i, end, *i))
                        for (auto j = i+1;  j != end;  j = std::upper_bound(j, end, *j)) {
                            for (const auto& op: ops) {
                                auto x = op->make_term(*i, *j);
                                if (x) out.insert(replace(*it, i, j, x));
                            }
                        }
                } catch (const std::bad_alloc&) {
                    // Ignore it; process what we've generated so far.
                }
            }
        }

        // Now we're in single-threaded code, we can pass the combined
        // results to the next combiner.
        for (auto& o: out)
            next->insert(std::move(o));

        target.increase_threshold(out.size());
    }

    // Helper methods used by the above

    // An upper bound on the possible number of output TermLists,
    // assuming every combination is valid.  If all n terms in the
    // input list are distinct, that's just ½n(n-1), but if values
    // are duplicated, we need to reduce n to the number of distinct
    // values, and then add in the cases where we pick two of the
    // same value.
    static int count_distinct_pairs(const TermList& terms)
    {
        int distinct = 0, duplicated = 0;
        auto it = terms.terms.begin(),
            end = terms.terms.end();
        while (it != end) {
            ++distinct;
            auto const& v = (*it)->value;
            if (++it == end || (*it)->value != v) continue;
            ++duplicated;
            while (++it != end && (*it)->value == v)
                ;
        }
        return distinct * (distinct - 1) / 2 + duplicated;
    }

    // Create a new TermList from o by replacing elements i and j with
    // newly-created term n.
    static TermList replace(const TermList& o, auto i, auto j, std::shared_ptr<const Term> n)
    {
        std::vector<std::shared_ptr<const Term>> r;
        r.reserve(o.terms.size() - 1);
        auto added = false;
        for (auto k = o.terms.begin();  k != o.terms.end();  ++k) {
            if (!added && (*k)->value < n->value) { r.push_back(n); added = true; }
            if (k != i && k != j) r.push_back(*k);
        }
        if (!added) r.push_back(n);
        return { r, o.target_value };
    }
};

#include <iostream>
std::ostream& operator<<(std::ostream& o, const Term& t)
{
    return o << t.to_string()<< " = " << t.value;
}
std::ostream& operator<<(std::ostream& o, const TermList& t)
{
    auto *sep = "";
    o << "[" << t.badness << "] ";
    for (auto const& x: t.terms)
        o << sep << *x, sep = ", ";
    return o;
}

int main(int argc, char **argv)
{
    if (argc < 3) {
        std::cerr << "Usage: " << argv[0] << " target term ...";
        return EXIT_FAILURE;
    }
    auto target = Target{std::stol(*++argv)};

    std::vector<std::shared_ptr<const Term>> terms;
    while (*++argv) {
        auto t = std::make_shared<LiteralTerm>(*argv);
        target.update(*t);
        terms.push_back(t);
    }
    std::sort(terms.begin(), terms.end());

    // Construct the sieve
    Combiner search{target, terms.size(), 2500000/terms.size() + 1}; // tunable - max set size
    search.insert({terms, target.value});
    search.finish();

    std::cout << "score " << std::fixed << target.score() << " for " << target.best << std::endl;
}

I compiled this using GCC 6.2, using g++ -std=c++17 -fopenmp -march=native -O3 (along with some debugging and warning options).

Python 2.7. Score: 1,67039106
So, I decided to have a throw at it myself. Nothing too fancy. This program sorts the numbers in reverse order (big to small), and tries all operators sequentially on the numbers. Blazing fast, but a performance that deserves to be superseded.
Here is the program:
import sys

def score(current,target):
    return abs(1.0-current/float(target))

# Process input and init variables
targetvalue=int(sys.argv[1].strip(','))
numbers=[int(a.strip(',')) for a in sys.argv[2:]]
numbers.sort(reverse=True)
expression='('+str(numbers[0])+')'
currentvalue=nextvalue=testvalue=numbers[0]

# Loop over all values (except the first one)
for value in numbers[1:]:
    # Set multiplication as the reference operator...
    testvalue=currentvalue*value
    minscore=score(testvalue,targetvalue)
    operator="*"
    nextvalue=testvalue

    # then try division (only if result is integer and not divided by zero)...
    if value!=0 and currentvalue%value==0:
        testvalue=currentvalue/value
        if score(testvalue,targetvalue)<minscore:
            operator="/"
            minscore=score(testvalue,targetvalue)
            nextvalue=testvalue

    # and addition...
    testvalue=currentvalue+value
    if score(testvalue,targetvalue)<minscore:
        operator="+"
        minscore=score(testvalue,targetvalue)
        nextvalue=testvalue

    # and subtraction...
    testvalue=currentvalue-value
    if score(testvalue,targetvalue)<minscore:
        operator="-"
        minscore=score(testvalue,targetvalue)
        nextvalue=testvalue

    # and concatenation
    testvalue=int(str(currentvalue)+str(value))
    if score(testvalue,targetvalue)<minscore:
        operator=""
        minscore=score(testvalue,targetvalue)
        nextvalue=testvalue

    # finally check if any operator improces the score. If so, append to the expression
    if score(nextvalue,targetvalue)<score(currentvalue,targetvalue):
        expression='('+expression+operator+str(value)+')'
        currentvalue=nextvalue

print(expression)

The output for all the test cases is:
((((((15)14)*13)-12)-11)-10)
((((((((((((999)996)+969)+966)+699)+696)+669)+666)*69)-66)-9)-6)
(((((((((333333333)+333333)+33333)+3333)+333)+33)+3)+3)+3)
(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((5)5)5)5)5)5)5)5)5)+5)+5)+5)+5)+5)+5)+4)+4)+4)+4)+4)+4)+4)+4)+4)+4)+4)+4)+4)+4)+4)+3)+3)+3)+3)+3)+3)+3)+3)+3)+3)+3)+3)+3)+3)+3)+2)+2)+2)+2)+2)+2)+2)+2)+2)+2)+2)+2)+2)+2)+2)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)
((((((((((((((((((((((((((((((((((((((((((((((199)197)193)+191)+181)+179)+173)+167)+163)+157)+151)+149)+139)+137)+131)+127)+113)+109)+107)+103)+101)+97)+89)+83)*79)-73)-71)-67)-61)-59)-53)-47)-43)-41)-37)-31)-29)-23)-19)-17)-13)-11)-7)-5)-3)/2)
(((((((((((((((((((((((((((((((992)930)870)+812)+756)+702)+650)+600)+552)+506)+462)+420)+380)+342)+306)+272)+240)+210)+182)*156)-132)-110)-90)-72)-56)-42)-30)/20)*12)-6)-2)
((((((((((((((((((((((((((((((((((((((39088169)+24157817)+14930352)+9227465)+5702887)+3524578)+2178309)+1346269)+832040)+514229)+317811)+196418)+121393)+75025)+46368)+28657)+17711)*10946)-6765)-4181)-2584)-1597)-987)-610)-377)-233)-144)-89)-55)-34)-21)-13)-8)-5)-3)/2)+1)+1)
(((((((((((((((((((((50000000)+20000000)+10000000)+5000000)+2000000)+100000)*50000)-20000)-10000)-5000)-2000)-1000)-500)-200)-100)-50)-20)-10)/5)*2)+1)