C³ÌÐò£ºÄ³Ë®ÍõµÄ·¢ÌûÊý³¬¹ý×ÜÌùÊýµÄÒ»°ë£¬ÕÒ³öÖ®
//ijˮÍõµÄ·¢ÌûÊý³¬¹ý×ÜÌùÊýµÄÒ»°ë£¬ÕÒ³öÖ®
int find(int *ID, int N)
{
int candidate;
int nTimes, i;
for (i = nTimes = 0; i < N; i++)
{
if (nTimes == 0)
{
candidate = ID[i];
nTimes = 1;
}
else if (candidate == ID[i])
{
nTimes++;
}
else
{
nTimes--;
}
}
return candidate;
}
Ïà¹ØÎĵµ£º
ͻ񻣼
ÔÚѧϰlinuxÄں˴úÂ뼰һЩ¿ªÔ´Èí¼þµÄÔ´Â루È磺DirectFB£©£¬¾³£¿ÉÒÔ¿´µ½ÓйØ
__attribute__µÄÏà¹ØʹÓᣱ¾ÎĽáºÏ×Ô¼ºµÄѧϰ¾Àú£¬½ÏΪÏêϸµÄ½éÉÜÁË__attribute__
Ïà¹ØÓï·¨¼°ÆäʹÓá£
---------------------------------------------------------
ÉùÃ÷£º
´ËÎÄΪԴ´£¬»¶ÓתÔØ£¬×ªÔØÇë±£ÁôÈçÏÂÐÅÏ¢
& ......
#include<stdio.h>
#include<math.h>
float x1,x2,disc,p,q;
int main()
{
void greater_than_zero(float,float);
void equal_to_zero(float,float);
void smaller_than_zero(float,float);
float a,b,c;
printf("\ninput a,b,c:");
scanf("%f,%f,%f",&a,&b,&c) ......
µÚ¶þÕ Õ÷·þ¿É²âÐÔÄÑÌâ
2.1 ¿É²âÐÔÎÊÌâÏê½â£¨1£©
µ¥Ôª²âÊÔЧÒæÌرð¸ß£¬·½·¨Ò²ºÜ¼òµ¥£¬µ«È´³¢ÊÔµÄÆóÒµºÜ¶à£¬³É¹¦ÊµÊ©µÄÆóÒµºÜÉÙ£¬ÎªÊ²Ã´ÄØ£¿Ö÷ÒªÔÒò¾ÍÊÇÄÑÓÚÍ»ÆƿɲâÐÔÎÊÌâ¡£“¿É²â”Õâ¸ö´Ê£¬Òâ˼ÒѾºÜÃ÷°×ÁË£¬Èç¹û²»“¿É²â”µÄ»°£¬ÄǾÍÊDz»Äܲ⣬û·¨²â£¬¾ÍÊÇ× ......
googletest C/C++ ²âÊÔ¿ò¼Ü·Ç³£ºÃÓ㬽éÉܼ°ÏÂÔØÇë¿´ http://code.google.com/p/googletest/
//============================================================================
// ʹÓà googletest ²âÊÔ¿ò¼Ü
//============================================================================
// Returns n! ......