C´úÂë¹æ·¶ÓëÔËÐÐʱ³¤·ÖÎöÄ£°å
/*****************************************************
Îļþ:main.c
¹¦ÄÜ:²âÊÔÔËÐÐʱ¼ä(C)!
×÷Õß:chinayaosir QQ:44633197
¹¤¾ß:VC++6.0±àÒëOK!
ÈÕÆÚ:11/28/2009
´úÂëĿ¼:
//1.°üº¬Í·Îļþ
//2.mainÖ÷³ÌÐò
//²»Í¬µÄË㷨ʵÏÖµÄÐÔÄÜ,ÔËÐÐʱ¼äÏà²î·Ç³£´óµÄ!
ÐÞ¸ÄÁбí:
*******************************************************/
//1.°üº¬Í·Îļþ
#include "prime.h"
#define MAXNUMBER 35535
//2.mainÖ÷³ÌÐò
int main(void){
long count;
clock_t begin,end;
begin=clock();
count=CountPrimeNumber(MAXNUMBER);
end= clock();
printf("ʹÓÃʱ¼ä(ºÁÃë):%d\n",(int)(end - begin));
return 0;
}
/*****************************************************
Îļþ:prime.h
¹¦ÄÜ:ËØÊý²Ù×÷º¯Êý½Ó¿Ú¶¨ÒåÍ·Îļþ
×÷Õß:chinayaosir QQ:44633197
¹¤¾ß:VC++6.0±àÒëOK!
ÈÕÆÚ:11/28/2009
´úÂëĿ¼:
//1.ʹÓÃÍ·Îļþ
//2.½Ó¿Ú¶¨Òå
ÐÞ¸ÄÁбí:
*******************************************************/
//1.ʹÓÃÍ·Îļþ
#include "stdio.h"
#include "stdlib.h"
#include "time.h"
#include "math.h"
//2.½Ó¿Ú¶¨Òå
//2.1¼ÆËã1µ½max·¶Î§ËØÊý¸öÊý¶¨Òå
extern long CountPrimeNumber(long max);
//2.2Åжϸø¶¨Êý×ÖnumberÊÇ·ñΪËØÊý?
//·µ»Ø1±íʾËØÊý£¬·µ»Ø0±íʾ·ÇËØÊý
extern int IsPrimeNumber(long number);
/*****************************************************
Îļþ:prime.c
¹¦ÄÜ:ËØÊý²Ù×÷º¯Êý½Ó¿ÚʵÏÖ
×÷Õß:chinayaosir QQ:44633197
¹¤¾ß:VC++6.0±àÒëOK!
ÈÕÆÚ:11/28/2009
´úÂëĿ¼:
//1.ʹÓÃÍ·Îļþ
//2.½Ó¿Ú¶¨Òå
ÐÞ¸ÄÁбí:
*******************************************************/
//1.°üº¬Í·Îļþ
#include "prime.h"
//2.1¼ÆËã1µ½max·¶Î§ËØÊý¸öÊýµÄ´úÂëʵÏÖ
long CountPrimeNumber(long max){
long i,findcount;
findcount=0;
for(i=1;i<=max;i++){
Ïà¹ØÎĵµ£º
Boss˵£¬Òª¿´OpenGL£¬¿´ÁË¿ìÒ»¸öÔ£¬×ÜËã³öÁ˸öÏñÑùµÄ¶«Î÷£¬ÓÃCдÁ˸ö3DÃÔ¹¬£¬
ËäȻֻÓÐ350ÐÐ
´úÂ룬²»¹ý±ßѧ±ßд£¬×ã×ãдÁËÒ»ÖÜʱ¼ä£¬»¹ÊÇСÓгɾ͸еģ¬»î»î»î£¡
&n ......
C/C++ÖÐnearºÍfarµÄÇø±ð
¹Ø¼ü×ÖnearºÍfarÊÜÄ¿±ê¼ÆËã»úÌåϵ½á¹¹µÄÓ°Ï졣Ŀǰ±à³ÌÖÐʹÓò»¶à¡£
near¹Ø¼ü×Ö´´½¨Ò»¸öÖ¸Ïò¿ÉÑ°Ö·ÄÚ´æµÍ¶Ë²¿·ÖµÄÄ¿±êÖ¸Õë¡£ÕâЩָÕëÕ¼ÓÃÄÚ´æµÄµ¥Ò»×Ö½Ú£¬²¢ÇÒËûÃÇÄܹ»Ö¸ÏòµÄÄÚ´æµ¥Ôª±»ÏÞÖƵ½256¸öλÖã¬Í¨³£ÊÇÔÚ0x0000~0x00ff·¶Î ......
To be continued...
µÚ8Õ UNIXϵͳ½Ó¿Ú
#include <stdio.h>
#include <fcntl.h>
#include "syscalls.h"
#defien PERMS 0666
void error(char *, ...);
/* cpº¯Êý: ½« f1 ¸´ÖƵ½ f2 */
int main(int argc, char *argv[])
{
int f1, f2, n;
char buf[BUFSIZ]; ......
1¡¢´ÓN¸öÊýÖÐÑ¡³ön¸ö×î´óµÄÊý£¬Ð´³ö˼·ºÍʵÏÖ¡£
ÏȶÁÈën¸ö£¬²¢ÇÒÅÅÐò£¬¶ÓÁУ¬¾ÍÊÇÓÐÐòµÄ¶ÓÁС£È»ºóÔÙÒ»¸ö¸ö¶Á£¬±È×î´óµÄÄǸö´óµÄʱºò¾ÍFIFO¡£
2¡¢Ð´³öÒ»¸öc/sͨѶ³ÌÐò£¬ÒªÇó·þÎñÆ÷¶ËÓ÷Ç×èÈûģʽ¡£
²»ÈóÊ飿²»ÈÃÉÏÍø£¿Ö±½Óקһ¾ä“ÄãYµ±ÎÒmanÎĵµ°¡£¿”
3¡¢TCP/UDPµÄÒìͬ¡£
È·ÈÏ»úÖÆ£¬²»ÖªµÀ»¹ÒªÎÊʲô£¬ ......