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

ÎÒµÄCʵ¼ù(9)£ºÎ»ºÍ×Ö½ÚµÄÖØÅÅ

  λºÍ×Ö½ÚµÄÖØÅÅÔÚÃÜÂëѧËã·¨ÖÐÓй㷺µÄÓ¦Óá£
/* rearran.c£ºÎ»ºÍ×Ö½ÚµÄÖØÅÅ */
/* λ·´×ª£ºÒÔ×ÖµÄÖÐÐÄΪ¶Ô³Æµã½øÐÐλ·´Éä
ÀýÈ磺 abcd efgh ijkl mnop ABCD EFGH IJKL MNOP
λ·´×ª£ºPONM LKJI HGFE DCBA ponm lkji hgfe dcba */
unsigned rev(unsigned x){
/* ½»»»ÏàÁڵĵ¥¸öλ */
x=(x & 0x55555555)<<1 | (x & 0xaaaaaaaa)>>1;
/* ½»»»ÏàÁÚµÄ2λ×Ö¶Î */
x=(x & 0x33333333)<<2 | (x & 0xcccccccc)>>2;
/* ½»»»ÏàÁÚµÄ4λ×Ö¶Î */
x=(x & 0x0f0f0f0f)<<4 | (x & 0xf0f0f0f0)>>4;
/* ½»»»ÏàÁÚµÄ8λ×Ö¶Î */
x=(x & 0x00ff00ff)<<8 | (x & 0xff00ff00)>>8;
/* ½»»»ÏàÁÚµÄ16λ×Ö¶Î */
x=(x & 0x0000ffff)<<16 | (x & 0xffff0000)>>16;
return x;
}
/* ×Ö½Ú·´×ª£ºÒÔ×ÖµÄÖÐÐÄΪ¶Ô³Æµã½øÐÐ×Ö½Ú·´Éä
ÀýÈ磺 abcd efgh ijkl mnop ABCD EFGH IJKL MNOP
×Ö½Ú·´×ª£ºIJKL MNOP ABCD EFGH ijkl mnop abcd efgh */
unsigned revw(unsigned x){
x=(x & 0x00ff00ff)<<8 | (x & 0xff00ff00)>>8;
x=(x & 0x0000ffff)<<16 | (x & 0xffff0000)>>16;
return x;
}
/* λ»ìÏ´£º½«ÓÒ°ë×ֵĸ÷¸öλÏà¼äµØ²åÈëµ½×ó°ë×ÖÖУ¬Î²²¿µÄλÈÔÈ»±£ÁôÔÚβ²¿
ÀýÈ磺abcd efgh ijkl mnop ABCD EFGH IJKL MNOP
»ìÏ´£ºaAbB cCdD eEfF gGhH iIjJ kKlL mMnN oOpP */
unsigned shuffling(unsigned x){
unsigned t;
/* ³õʼ£ºabcd efgh ijkl mnop ABCD EFGH IJKL MNOP */
/* abcd efgh ABCD EFGH ijkl mnop IJKL MNOP */
t=(x ^ (x>>8)) & 0x0000ff00; x=x ^ t ^ (t<<8);
/* abcd ABCD efgh EFGH ijkl IJKL mnop MNOP */
t=(x ^ (x>>4)) & 0x00f000f0; x=x ^ t ^ (t<<4);
/* abAB cdCD efEf ghGH ijIJ klKL mnMN opOP */
t=(x ^ (x>>2)) & 0x0c0c0c0c; x=x ^ t ^ (t<<2);
/* aAbB cCdD eEfF gGhH iIjJ kKlL mMnN oOpP */
t=(x ^ (x>>1)) & 0x22222222; x=x ^ t ^ (t<<1);
return x;
}
/* Äæ»ìÏ´ */
unsigned unshuffling(unsigned x){
/* ÒÔÏà·´µÄ˳Ðò½øÐн»»»¼´¿ÉʵÏÖÄæ»ìÏ´ */
t=(x ^ (x>>1)) & 0x22222222; x=x ^ t ^ (t<&


Ïà¹ØÎĵµ£º

linuxÄÚºËÒÆÖ²s3c2410£¬ÒÆÖ²Õýʽ¿ªÊ¼2

ÄÚºËÆô¶¯µÄÏÖÔÚÒѾ­ÊÇ¿ªÊ¼Ö´Ðк¯Êýstart_kernelº¯ÊýÁË¡£start_kernelº¯ÊýÔÚinit/main.cÖж¨Òå¡£start_kernelº¯ÊýÖ»ÊÇÍê³É
ÏàÓ¦µÄ½á¹¹µÄ³õʼ»¯ÈÎÎñ¡£
    printk(KERN_NOTICE);
    printk(linux_banner);
    setup_arch(&command_line);
ÔÚubootµÄÒ»Ö±¹ý³ÌÖУ¬uboo ......

¹ØÓÚc,c++Êä³ö¸ñʽ¿ØÖÆ

1.
printf("%.9lf\n",sum); 
//Êä³öСÊýµãºó9λ²»Ê¡È¥Ä©Î²¶àÓàµÄ0
2.
printf("%.10g\n",sum);
 //Êä³öСÊýµãºó9λ²»Ê¡È¥Ä©Î²¶àÓàµÄ0
3.
#include<iomanip>
cout<<setprecision(10)<<sum<<endl;
//Êä³öСÊýµãºó9λʡȥĩβ¶àÓàµÄ0
4. 
#include<iomanip>
cout.pre ......

keil C ´ÓÁãѧÆð ½Ìѵ1

#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar num;
void main()
{
 TMOD=0x01;
 TH0=(65536-45872)/256;
 TL0=(65536-45872)%256;
 EA=1;
 ET0=1;
 TR0=1;
 P1=0xFF;
 while(1);
}
void T0_time() interrupt 1
{
  ......

cµÄIO

²¿·ÖÄÚÈÝÀ´×Ôhttp://www.programfan.com/article/2674.htmlÒÔ¼°http://www.programfan.com/article/showarticle.asp?id=2675
²¿·Ö·­ÒëÀ´×ÔTUM skript£¨c programmieren);
1.printf()£º
ǧÍò²»ÒªÒÅÍüÔÚprintf()µÄ×îºóÌí¼ÓNewLine"\n"¡£ÒòΪÔÚcµÄ¿âÖÐͨ³£ÓÐÐлº´æ»úÖÆ£¬Õâ¸öÒâζ×ÅÖ»Óе±Ò»ÐеÄÊäÈëͨ¹ý"\n"½áÊøÖ®Ç°£¬ÐеÄÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ