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

CÓïÑÔÖ¸Õ루Èý£©

¡¾Àý10.21¡¿ÓÃÑ¡Ôñ·¨¶Ô10¸öÕûÊýÅÅÐò¡£
main()
{int *p,i,a[10]={3,7,9,11,0,6,7,5,4,2};
printf("The original array:\n");
for(i=0;i<10;i++)
   printf("%d,",a[i]);
printf("\n");
p=a;
sort(p,10);
for(p=a,i=0;i<10;i++)
{printf("%d ",*p);p++;}
printf("\n");
}
sort(int x[],int n)
{int i,j,k,t;
for(i=0;i<n-1;i++)
   {k=i;
    for(j=i+1;j<n;j++)
      if(x[j]>x[k])k=j;
    if(k!=i)
    {t=x[i];x[i]=x[k];x[k]=t;}
    }
}
˵Ã÷£ºº¯ÊýsortÓÃÊý×éÃû×÷ΪÐβΣ¬Ò²¿É¸ÄΪÓÃÖ¸Õë±äÁ¿£¬Õâʱº¯ÊýµÄÊײ¿¿ÉÒÔ¸ÄΪ£º
sort(int *x,int n) ÆäËû¿ÉÒ»Âɲ»¸Ä¡£
10.3.4 Ö¸Ïò¶àάÊý×éµÄÖ¸ÕëºÍÖ¸Õë±äÁ¿
±¾Ð¡½ÚÒÔ¶þάÊý×éΪÀý½éÉܶàάÊý×éµÄÖ¸Õë±äÁ¿¡£
1. ¶àάÊý×éµÄµØÖ·
ÉèÓÐÕûÐͶþάÊý×éa[3][4]ÈçÏ£º
0   1   2   3
    4   5   6   7
8   9 10 11
ËüµÄ¶¨ÒåΪ£º
int a[3][4]={{0,1,2,3},{4,5,6,7},{8,9,10,11}}
ÉèÊý×éaµÄÊ×µØַΪ1000£¬¸÷ϱê±äÁ¿µÄÊ×µØÖ·¼°ÆäÖµÈçͼËùʾ¡£
Ç°Ãæ½éÉܹý£¬£ÃÓïÑÔÔÊÐí°ÑÒ»¸ö¶þάÊý×é·Ö½âΪ¶à¸öһάÊý×éÀ´´¦Àí¡£Òò´ËÊý×éa¿É·Ö½âΪÈý¸öһάÊý×飬¼´a[0]£¬a[1]£¬a[2]¡£Ã¿Ò»¸öһάÊý×éÓÖº¬ÓÐËĸöÔªËØ¡£
ÀýÈça[0]Êý×飬º¬ÓÐa[0][0]£¬a[0][1]£¬a[0][2]£¬a[0][3]ËĸöÔªËØ¡£
Êý×é¼°Êý×éÔªËصĵØÖ·±íʾÈçÏ£º
´Ó¶þάÊý×éµÄ½Ç¶ÈÀ´¿´£¬aÊǶþάÊý×éÃû£¬a´ú±íÕû¸ö¶þάÊý×éµÄÊ×µØÖ·£¬Ò²ÊǶþάÊý×é0ÐеÄÊ×µØÖ·£¬µÈÓÚ1000¡£a+1´ú±íµÚÒ»ÐеÄÊ×µØÖ·£¬µÈÓÚ1008¡£Èçͼ£º
a[0]ÊǵÚÒ»¸öһάÊý×éµÄÊý×éÃûºÍÊ×µØÖ·£¬Òò´ËҲΪ1000¡£*(a+0)»ò*aÊÇÓëa[0]µÈЧµÄ£¬ Ëü±íʾһάÊý×éa[0]0 ºÅÔªËصÄÊ×µØÖ·£¬Ò²Îª1000¡£&a[0][0]ÊǶþάÊý×éaµÄ0ÐÐ0ÁÐÔªËØÊ×µØÖ·£¬Í¬ÑùÊÇ1000¡£Òò´Ë£¬a£¬a[0]£¬*(a+0)£¬*a£¬&a[0][0]ÊÇÏàµÈµÄ¡£
ͬÀí£¬a+1ÊǶþάÊý×é1ÐеÄÊ×µØÖ·£¬µÈÓÚ1008¡£a[1]Êǵڶþ¸öһάÊý×éµÄÊý×éÃûºÍÊ×µØÖ·£¬Òò´ËҲΪ1008¡£&a[1][0]ÊǶþάÊý×éaµÄ1ÐÐ0ÁÐÔªËصØÖ·£¬Ò²ÊÇ1008¡£Òò´Ëa+1,a[1],*(a+1),&a[1][0]ÊǵÈͬµÄ¡£
Óɴ˿ɵóö£ºa+i£¬a[i]£¬*(a+i)£¬&a[i][0]ÊǵÈͬµÄ¡£
´ËÍ⣬&a[i]ºÍa[i]Ò²ÊǵÈͬµÄ¡£ÒòΪÔÚ¶þάÊý×éÖв»ÄÜ°Ñ&a[i]Àí½âΪԪËØa[i]µÄµØÖ·£¬²»´æ


Ïà¹ØÎĵµ£º

ÔÚs3c2410ÉÏÔËÐÐlinuxµÄ·½·¨

1. ×¼±¸¹¤×÷£º
¿ª·¢°åµÄipÉèÖÃ
gzsd> net set ipaddr 192.168.0.11 ÉèÖÿª·¢°åµÄIP
gzsd> net set serverip 192.169.0.10 ÉèÖÃtftp serverµÄIP
gzsd> net set netmask 255.255.255.0 ÉèÖÃ×ÓÍøÑÚÂë
gzsd> net save ±£´æÉèÖÃ
gzsd> net ping XXX ²âÊÔÁ¬½Ó×´¿ö
°²×°tftp·þÎñÆ÷
windowsÏÂ
ÔËÐйâÅ̹¤¾ß ......

ʲô²Å½Ð¾«Í¨C/C++


It is better to have the ability of fast learning
ÓÐÒ»ÌìÄã覺µÃÉõ麼¶¼ÖªµÀÁË   ¿É±¯
ÓÐÒ»ÌìÄã卻發現ÄãÉõ麼¶¼²»會 ¼ÓÓÍ°É
ÓÐÒ»ÌìÄã發現ÄãÓÖÉõ麼¶¼會ÁË 繼續
ÓÐÒ»ÌìÄã發現ÄãÉõ麼¶¼²»會ÁË ³É¹¦ÁË ......

CÓïÑÔº¯Êý£¨Ò»£©


ÔÚÇ°ÃæÒѾ­½éÉܹý£¬£ÃÔ´³ÌÐòÊÇÓɺ¯Êý×é³ÉµÄ¡£ËäÈ»ÔÚÇ°Ãæ¸÷ÕµijÌÐòÖдó¶¼Ö»ÓÐÒ»¸öÖ÷º¯Êýmain()£¬µ«ÊµÓóÌÐòÍùÍùÓɶà¸öº¯Êý×é³É¡£º¯ÊýÊÇ£ÃÔ´³ÌÐòµÄ»ù±¾Ä£¿é£¬Í¨¹ý¶Ôº¯ÊýÄ£¿éµÄµ÷ÓÃʵÏÖÌض¨µÄ¹¦ÄÜ¡££ÃÓïÑÔÖеĺ¯ÊýÏ൱ÓÚÆäËü¸ß¼¶ÓïÑÔµÄ×Ó³ÌÐò¡££ÃÓïÑÔ²»½öÌṩÁ˼«Îª·á¸»µÄ¿âº¯Êý(ÈçTurbo C£¬MS C¶¼ÌṩÁËÈý°Ù¶à¸ö¿âº¯Êý)£¬» ......

CÓïÑÔº¯Êý£¨¶þ£©

¡¾Àý8.6¡¿HanoiËþÎÊÌâ
    Ò»¿é°åÉÏÓÐÈý¸ùÕ룬A£¬B£¬C¡£AÕëÉÏÌ×ÓÐ64¸ö´óС²»µÈµÄÔ²ÅÌ£¬´óµÄÔÚÏ£¬Ð¡µÄÔÚÉÏ¡£Èçͼ5.4Ëùʾ¡£Òª°ÑÕâ64¸öÔ²ÅÌ´ÓAÕëÒƶ¯CÕëÉÏ£¬Ã¿´ÎÖ»ÄÜÒƶ¯Ò»¸öÔ²ÅÌ£¬Òƶ¯¿ÉÒÔ½èÖúBÕë½øÐС£µ«ÔÚÈκÎʱºò£¬ÈκÎÕëÉϵÄÔ²Å̶¼±ØÐë±£³Ö´óÅÌÔÚÏ£¬Ð¡ÅÌÔÚÉÏ¡£ÇóÒƶ¯µÄ²½Öè¡£
±¾ÌâËã·¨·ÖÎöÈçÏ£¬ÉèAÉÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ