C+C C×C
1.CÓïÑÔÖУ¬long±»´æ´¢ÎªËĸö×ֽڵIJ¹Â롣дһ¸ö³ÌÐò£¬·Ö±ð½«ÕâËĸö×Ö½ÚµÄÄÚÈÝÈ¡³ö£¬ÒÔ16½øÖƵķ½Ê½ÏÔʾÔÚÆÁÄ»ÉÏ¡£³ÌÐòËùÐèµÄlongÓÉÓû§´Ó¼üÅÌÊäÈ룬0±íʾÊäÈë½áÊø¡£
³ÌÐòÔËÐÐЧ¹ûÈçÏ£º
input n: 12345678<»Ø³µ>
hex: 00 BC 61 4E
input
n: -12345678<»Ø³µ>
hex: FF 43 9E B2
input n: 0<»Ø³µ>
bye!
#include<stdio.h>
int main()
{
long n,i,x;
printf("input n:");
scanf("%d",&n);
if(n==0)
printf("bye!\n");
else
{
printf("hex:");
for(i=0;i<8;i++)
{
if(i!=0&&i%2==0)
printf(" ");
x=((n&(0xf<<(28-4*i)))>>(28-4*i))&(0xf);
printf("%X",x);
}
printf("\n");
}
return 0;
}
2.ÓÐÒ»ÐÐÓû§ÊäÈëµÄÓ¢Îľä×Ó (³¤¶È<80£¬ÎÞ±êµã£¬µ¥´ÊÖ®¼ä¿ÉÄÜÓжà¸ö¿Õ¸ñ)
¡£Ð´Ò»¸ö³ÌÐò£¬¼ÆËã³ö¾ä×ÓÖгöÏÖµÄËùÓе¥´ÊÒÔ¼°µ¥´Ê³öÏֵĴÎÊý¡£ÒªÇóËùÓÐÕÒµ½µÄµ¥´ÊºÍ´ÎÊý¶¼Ô¤ÏÈ´æ´¢ÔÚÏÂÃæÕâ¸öÊý×éÖУºstruct tagWord
{ char word[20]; int count;} wordCount[40]; ×îºóÔÙͳһÊä³ö¡£
ÀýÈçÓû§ÊäÈ룺abc ab ab abc abcd
Êä³öΪ£º
abc: 2
ab: 2
abcd: 1
#include<stdio.h>
#include<string.h>
int main()
{
int i,j,k,u,t=0,h=0;
char c;
struct tagWord
{
char word[20];
int count;
}wordCount[40];
for(i=0;i<40;i++)
{
for(j=0;j<20;j++)
{
wordCount[i].word[j]=0;
wordCount[i].count=0;
}
}
for(i=0,j=0,k=0;i<80;i++,h=0)
{
c=getchar();
if(c!=' '&&c!='\n')
{
t=0;
wordCount[j].word[k]=c;
k++;
}
else
{
if(c==' '&&t==0)
{
for(u=0;u<j;u++)
{
if(strcmp(wordCount[u].word,wordCount[j].word)==0)
{
h=1;
break;
}
}
if(h==1)
{
wordCount[u].count++;
k=0;
t=1;
continue;
}
wordCount[j].count++;
j++;
k=0;
t=1;
}
else
{
if(c==' '&&t==1)
continue;
else
{
for(u=0;u<j;u++)
Ïà¹ØÎĵµ£º
ÉÏһƪÖÐÎÒÃÇÒѾÁ˽âÈçºÎÔÚPython³ÌÐòºÍCÄ£¿éÖ®¼ä½øÐÐÖµµÄÏ໥´«µÝ£¬ÏÖÔÚÎÒÃÇÀ´½øÈëʵ×÷½×¶Î£¬¿´¿´ÈçºÎ½«Ò»¸öCÓïÑÔ¿ª·¢µÄ¿ªÔ´mp3±à½âÂë¿âLAME°üװΪһ¸öPythonÏ¿ÉÒÔʹÓõÄÀ©Õ¹Ä£¿é¡£Ê×ÏÈÈ¥http://lame.sourceforge.net/download.phpÏÂÔØLAMEµÄÔ´´úÂ룬ȻºóÇл»µ½rootÓû§±àÒëÔ´´úÂ룬./configure
make
make instal ......
Óë &£º ÈκÎλÓÃ&ÔËËãÓë0½áºÏ½á¹ûΪ0£¬Óë1½áºÏ½á¹ûΪÆä±¾Éí£»
»ò | £º ÈκÎλÓÃ|ÔËËãÓë0½áºÏ½á¹ûΪÆä±¾Éí£¬Óë1½áºÏ½á¹ûΪ1£»
Òì»ò ^ £º ÈκÎλÓÃ^ÔËËãÓë0½áºÏ½á¹ûΪÆä±¾Éí£¬Óë1½áºÏÔòÈ¡·´£» ......
ÍøÉÏËÑË÷ÁËÒ»´ó¶ÑÈ¥µô/*ºÍ*/Ö®¼ä×¢Ê͵ĴúÂë,¾ÍÏñ<The C Programming Language>Á·Ï°1-23ÀïÓÐÈË˵µÄÒ»Ñù
´ó²¿·Ö¶¼»á±»ÒÔϵijÌÐòbroken,Õâ¸ö¹¦ÄÜ¿´ÆðÀ´¼òµ¥,ʵ¼ÊÉϺÜÓÐÄѶÈ.ÍøÉÏʵÏֵĴúÂë,³ýÁËÎÒÕÒµ½µÄÒ»¸öÓÃÎļþÖ¸ÕëʵÏÖµÄûÓÐÎÊÌâÍâ,ÆäÓàµÄ¶¼´æÔÚ¸÷ÖÖbug,²»ÐŵĻ°¾ÍÓÃÒÔϵijÌÐò²âÊÔÒ»ÏÂ:-),µ±È»Õâ¸ö³ÌÐòÒ²²»¹»ÍêÉÆ ......
CÓïÑÔ£¬ÓÐʱºòÕæ²»µÃ²»ÅåËü£¬ÕÕÀí˵£¬Îļþ´¦Àíº¯ÊýÊÇûÓÐʲôºÃ½²µÄ£¬µ«¶ÔÓںܶàCÈëÃŵÄÈËÀ´Ëµ£¬ËƺõÒ²ÊÇÖµµÃ¾²ÐÄƷζһ·¬µÄ¡£
CÖеÄÎļþ´¦Àíº¯Êý²¢²»ºÜ¶à£¬¶ø³£Óõģ¬Ëƺõ¸üÉÙ¡£
º¯Êý²»ÄÑ£¬µ«²¢²»´ú±íÎļþ´¦ÀíÒ²²»ÄÑ¡£ËƺõÓÖÒªÓеãÅÜÌâÁË£¬ÎÒ×ÜÊÇϲ»¶ÅÜÌâ¡£Éϼ¸Ìì×öÃΣ¬Ãε½ÎÒµôµ½ÔÂÇòÉÏÈ¥À²……
¶ÔÎļþµ ......
¿ªÊ¼—ÔËÐЗgpedit.msc£¬´ò¿ª×é²ßÂÔ´°¿Ú—Óû§ÅäÖÃϵē¹ÜÀíÄ£°å”—WINDOWS×é¼þ£¬Ë«»÷´ò¿ªWindows×ÊÔ´¹ÜÀíÆ÷£¬È»ºóË«»÷“·ÀÖ¹´ÓÎҵĵçÄÔ·ÃÎÊÇý¶¯Æ÷”£¬´ò¿ª“ÊôÐÔ”´°¿Ú£¬Ñ¡Ôñ“ÒÑÆôÓÔ£¬È»ºóÑ¡Ôñ“½öÏÞÖÆÇý¶¯Æ÷C”£¨Äã¿ÉÒÔ°ÑÄã²»ÏëÈñðÈË´ò¿ªµ ......