Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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;
}


Ïà¹ØÎĵµ£º

GNU C __attribute__ »úÖƼò½é

ͻ񻣼
ÔÚѧϰlinuxÄں˴úÂ뼰һЩ¿ªÔ´Èí¼þµÄÔ´Â루È磺DirectFB£©£¬¾­³£¿ÉÒÔ¿´µ½ÓйØ
__attribute__µÄÏà¹ØʹÓᣱ¾ÎĽáºÏ×Ô¼ºµÄѧϰ¾­Àú£¬½ÏΪÏêϸµÄ½éÉÜÁË__attribute__
Ïà¹ØÓï·¨¼°ÆäʹÓá£
---------------------------------------------------------
ÉùÃ÷£º
  ´ËÎÄΪԭ´´£¬»¶Ó­×ªÔØ£¬×ªÔØÇë±£ÁôÈçÏÂÐÅÏ¢
& ......

Çó·½³Ìax^2+bx+c=0µÄ¸ù(º¯Êý)

#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) ......

C/C++µ¥Ôª²âÊÔÀíÂÛ¾«Òª£¨Î壩

µÚ¶þÕ Õ÷·þ¿É²âÐÔÄÑÌâ
 
2.1 ¿É²âÐÔÎÊÌâÏê½â£¨1£©
 
    µ¥Ôª²âÊÔЧÒæÌرð¸ß£¬·½·¨Ò²ºÜ¼òµ¥£¬µ«È´³¢ÊÔµÄÆóÒµºÜ¶à£¬³É¹¦ÊµÊ©µÄÆóÒµºÜÉÙ£¬ÎªÊ²Ã´ÄØ£¿Ö÷ÒªÔ­Òò¾ÍÊÇÄÑÓÚÍ»ÆƿɲâÐÔÎÊÌâ¡£“¿É²â”Õâ¸ö´Ê£¬Òâ˼ÒѾ­ºÜÃ÷°×ÁË£¬Èç¹û²»“¿É²â”µÄ»°£¬ÄǾÍÊDz»Äܲ⣬û·¨²â£¬¾ÍÊÇ× ......

C³ÌÐò£ºÊ¹Óà googletest ²âÊÔ¿ò¼Ü

googletest C/C++ ²âÊÔ¿ò¼Ü·Ç³£ºÃÓ㬽éÉܼ°ÏÂÔØÇë¿´  http://code.google.com/p/googletest/
//============================================================================
// ʹÓà googletest ²âÊÔ¿ò¼Ü
//============================================================================

// Returns n! ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ