|
![](/i/fill.gif) |
Am 20.08.2013 16:33, schrieb scott:
>>> int abs(int input)
>>>> {
>>>> int value = 0;
>>>> for (int n = input; n != 0; n++)
>>>> {
>>>> value++;
>>>> }
>>>> return value;
>>>> }
>>>
>>> That's a pretty epic fail.
>>
>> As I say, the impressive thing is that it's a correct (yet inefficient)
>> implementation of negate().
>
> Yes, there must be a prize for that somewhere,
http://www.ioccc.org/
(Okay, this is for C code, not C#, but it should be easy enough to port
the function)
Post a reply to this message
|
![](/i/fill.gif) |