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

C/C++ Ö®ÂÃ

ûÏëµ½ ûÏëµ½ ÍòÍòûÏëµ½
¶ÔC++°ËÇÏֻͨÁË7ÇϵÄÎÒ£¬¾¹È»Òª¿ªÊ¼¸ãc++Á˵Ä˵£¬ÕæÊǺò»´Ì¼¤¡£
²»¸ÒÏàÐÅ£¬²»¸ÒÏàÐÅ¡£
ÀàÐÍÊÇʲôÍæÒ⣿ÀàÔõôд£¿×Ö·û´®Ôõô´¦Àí£¿ÔõôÊÍ·ÅÄڴ棿
ż²»Öª£¬²»Öª£¬ÕæµÄ²»Öª¡£¡£¡£¡£
°¥       Í궼ÍêÁË¡£
°¦ ²»¹ÜÔõô˵¶¼ÒªÈ¥Ñ§µÄ¡£¡£¡£Ò»µãÕÞ¶¼Ã»ÓÐ
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
namespace Algorythms
{

int insert_sort(int Array[],int Length)
{
for( int i = 0 ; i < Length ; i ++ )
{
int p = i;
for( int j = i ; j < Length ; j ++ )
{
if(Array[j] < Array[p])
{
p = j;
}
}
if(p != i) //Swap
{
int tmp = Array[p];
Array[p] = Array[i];
Array[i] = tmp;
}
}
return 0;
}

int Merge(int Array[],int p,int q,int r)
{
int a = q - p + 1;
int b = r - q;
int *L = new int[a + 1];
int *R = new int[b + 1];
int i = 0;
int j = 0;
for(i = 0; i < a; i ++)
{
L[i] = Array[p+i];
}
for(i = 0; i < b; i ++)
{
R[i] = Array[q+i+1];
}
L[a] = 0x7FFFFFF;
R[b] = 0x7FFFFFF;
i = 0;
j = 0;
for(int k = p; k <= r ; k ++)
{
if(L[i] <= R[j])
{
Array[k] = L[i];
i ++;
}
else
{
Array[k] = R[j];
j ++;
}
}
return 0;
}
int Merge_Sort(int Array[],int p,int r)
{
if(p < r)
{
int q = (p + r) / 2;
Merge_Sort(Array,p,q);
Merge_Sort(Array,q+1,r);
Merge(Array,p,q,r);
}
return 0;
}
int Reserver(int Array[],int Length)
{
int * e = Array + Length -1;
int * f = Array;
while(f < e)
{
int tmp = *f;
*f = *e;
*e = tmp;
f ++;
e --;
}
return 0;
}
int Exchange(int *a,int *b)
{
int tmp = *a;
*a = *b;
*b = tmp;
return 0;
}
int Bubble_Sort(int Array[],int Length)
{
for(int i = 0; i < Length - 1; i ++)
{
for(int j = Length - 1; j >= i + 1; j --)
{
if(Array[j] < Array[j - 1])
{
Ex


Ïà¹ØÎĵµ£º

C/C++ÃæÊÔÌâÁù£¨¾­µä) ¡¾×ª¡¿

1.ÇóÏÂÃ溯ÊýµÄ·µ»ØÖµ£¨Î¢Èí£©
int func(x)
{
    int countx = 0;
    while(x)
    {
          countx ++;
          x = x&(x-1);
     } ......

C ÓïÑÔÖÐÇå¿ÕÊäÈ뻺³åÇø

CÓïÑÔÖÐÓм¸¸ö»ù±¾ÊäÈ뺯Êý£º
//»ñÈ¡×Ö·ûϵÁÐ
int fgetc(FILE *stream);
int getc(FILE *stream);
int getchar(void);
 
//»ñÈ¡ÐÐϵÁÐ
char *fgets(char * restrict s, int n, FILE * restrict stream);
char *gets(char *s);//¿ÉÄܵ¼ÖÂÒç³ö£¬ÓÃfgets´úÌæÖ®¡£
 
//¸ñʽ»¯ÊäÈëϵÁÐ
int fscanf(FILE * r ......

[ת]C\C++ÓïÑÔÈëÃÅƪϵÁÐ

ËäȻѧϰÁ˺öàÄê,µ«ÐèҪϸ¾¿Ä³Ð©»ù´¡ÖªÊ¶µÄʱºò»¹ÊÇ·¢ÏÖ×Ô¼ºÍüÁË, ´Ó±ðÈ˵ÄÎÄÕ°ǹýÀ´,ÒÔ±¸¸´Ï°
²Î¿¼: http://blog.csdn.net/masefee/archive/2009/12/28/5090820.aspx
============================================================
֮ǰµÄ¶¨Î»¿ÉÄÜÖ÷ҪΪÁËÑо¿µ×²ã¼°Ò»Ð©½Ï¸´ÔÓµÄÎÊÌâÉÏ£¬¶øºöÂÔÁËһЩ³õѧµÄÅóÓÑ¡£µ¼ ......

ÈçºÎÀí½âcºÍc++ µÄ¸´ÔÓÀàÐÍÉùÃ÷

Ôø¾­Åöµ½¹ýÈÃÄãÃԻ󲻽⡢ÀàËÆÓÚint * (* (*fp1) (int) ) [10];ÕâÑùµÄ±äÁ¿ÉùÃ÷Â𣿱¾ÎĽ«ÓÉÒ×µ½ÄÑ£¬Ò»²½Ò»²½½Ì»áÄãÈçºÎÀí½âÕâÖÖ¸´ÔÓµÄC/C++ÉùÃ÷¡£
¡¡¡¡ÎÒÃǽ«´ÓÿÌ춼ÄÜÅöµ½µÄ½Ï¼òµ¥µÄÉùÃ÷ÈëÊÖ£¬È»ºóÖð²½¼ÓÈëconstÐÞÊηûºÍtypedef£¬»¹Óк¯ÊýÖ¸Õ룬×îºó½éÉÜÒ»¸öÄܹ»ÈÃÄã׼ȷµØÀí½âÈκÎC/C++ÉùÃ÷µÄ“ÓÒ×ó·¨Ôò”¡£ ......

C/C++ÏÂASCIIÓëEBCDICÂëÖ®¼äµÄÇáËÉת»»

EBCDIC (Extended Binary Coded Decimal Interchange Code) À©Ôö¶þ½øʽʮ½ø½»»»Â룬ΪIBMÓÚ1963Ä꣭1964Äê¼äÍƳöµÄ×Ö·û±àÂë±í£¬¸ù¾ÝÔçÆÚ´ò¿×»úʽµÄ¶þ½ø»¯Ê®½øÊý(BCD, Bindary Coded Decimal)ÅÅÁжø³É¡£ÊÇIBMÃÔ¶û¼¶ÒÔÉϵçÄԵıê×¼Âë¡£
ASCII£¨American Standard Code for Information Interchange£¬ÃÀ¹úÐÅÏ¢»¥»»±ê×¼´úÂë£©Ê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ