群硕笔试第一题

2008-03-31 10:37 / no comment / 6 views /

计算一个整数中有多少个”1″

int count ( int i )
{
int count = 0;
while( i!=0 )
{
i = i&(i-1);
count++;
}
return count;
}

回忆那天群硕面试,真的是惭愧。以为自己在技术面试时肯定没问题,却败得一塌糊涂。想过面试官问多么有难度的问题,却没想到如此他如此较真的拿笔试第一题说事。在编程上向来思路清晰,这次我却犯了傻。当着面试官的面现场写程序,却写一遍马上推翻一遍……直到全盘否定了自己……

没有发现自己思路这么混乱过。但是仔细回忆,的确已经很长时间没有动手编过程序。这不像一个编程的人。

Tags: .

Get a Trackback link

No Comments Yet

You can be the first to comment!

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>