也该来点不是讲看片的…

今天看到一段同事写的代码,看得我实在是既惊又诧,大意如下:

unsigned int my_funky_function(unsigned int a, unsigned int b)
{
    unsigned int i, result = 0;
    for(i = 0; i < b; i++)
        result += a;
    return result;
}

当然,我不得不承认,这的确是做乘法的一种方法…

Advertisements

No comments yet

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: