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

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++){
      


Ïà¹ØÎĵµ£º

cÓïÑÔ»ù´¡£¨ÊÇʱºò²¹²¹cµÄ»ù´¡ÁË£©

¿´Êý¾Ý½á¹¹ñÍÕ»µÄʱºòдÁËÕâôһ¶Î´úÂë
#include<stdio.h>
#include<stdlib.h>
struct linkstack
{
int data;
struct linkstack *next;
};
int initstack(linkstack * S)
{
S = (linkstack *)malloc(sizeof(linkstack));
if(S == NULL) return 0;
S->next = NULL;
return 1;
}
int main(int ......

³£ÓÃCÍ·Îļþ¼°ÆäÔÚ±ê×¼C++Öеı£Áô

Í·ÎļþµÄ×÷ÓÃ
ÔçÆڵıà³ÌÓïÑÔÈçBasic¡¢Fortran ûÓÐÍ·ÎļþµÄ¸ÅÄC++/C ÓïÑԵijõѧÕßËäÈ»»áÓÃʹÓÃÍ·Îļþ£¬µ«³£³£²»Ã÷ÆäÀí¡£ÕâÀï¶ÔÍ·ÎļþµÄ×÷ÓÃÂÔ×÷½âÊÍ£º
£¨1£©Í¨¹ýÍ·ÎļþÀ´µ÷Óÿ⹦ÄÜ¡£ÔںܶೡºÏ£¬Ô´´úÂë²»±ã£¨»ò²»×¼£©ÏòÓû§¹«²¼£¬Ö»ÒªÏòÓû§ÌṩͷÎļþºÍ¶þ½øÖƵĿ⼴¿É¡£Óû§Ö»ÐèÒª°´ÕÕÍ·ÎļþÖеĽӿÚÉùÃ÷À´µ÷Óÿ⹦ ......

CºÍC++µÄ±ê×¼¿â

CºÍC++µÄ±ê×¼¿â
ĬÈÏ·ÖÀà   2008-02-28 14:28   ÔĶÁ3   ÆÀÂÛ0  
×ֺţº ´ó´ó  ÖÐÖР СС
http://blog.chinaunix.net/u/6776/showart_186792.html C/C++Éî²ã̽Ë÷
    ±¾Ð¡½ÚÎÒÃǸÅÀÀÒ»ÏÂC/C++±ê×¼¿âµÄȫò¡£
    C/C++±ê×¼¿âµÄÄÚ ......

C/C++ÖÐnearºÍfarµÄÇø±ð

C/C++ÖÐnearºÍfarµÄÇø±ð
      ¹Ø¼ü×ÖnearºÍfarÊÜÄ¿±ê¼ÆËã»úÌåϵ½á¹¹µÄÓ°Ï졣Ŀǰ±à³ÌÖÐʹÓò»¶à¡£
      near¹Ø¼ü×Ö´´½¨Ò»¸öÖ¸Ïò¿ÉÑ°Ö·ÄÚ´æµÍ¶Ë²¿·ÖµÄÄ¿±êÖ¸Õë¡£ÕâЩָÕëÕ¼ÓÃÄÚ´æµÄµ¥Ò»×Ö½Ú£¬²¢ÇÒËûÃÇÄܹ»Ö¸ÏòµÄÄÚ´æµ¥Ôª±»ÏÞÖƵ½256¸öλÖã¬Í¨³£ÊÇÔÚ0x0000~0x00ff·¶Î ......

cÎļþ²Ù×÷

#include <stdio.h>
#include <stdlib.h> //use malloc, free
#include <string.h> //use memset
#include <ctype.h> //use isdigit
#define ERROR_ILLEGAL_CHAR 1 //define error illegal character as 1
#define ERROR_NUMBERS_DIF 2 //define error numbers is not the same in diffe ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ