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

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


Ïà¹ØÎĵµ£º

ʹÓÃCÓïÑÔÀ©Õ¹Python(Èý)

ÉÏһƪÖÐÎÒÃÇÒѾ­Á˽âÈçºÎÔÚPython³ÌÐòºÍCÄ£¿éÖ®¼ä½øÐÐÖµµÄÏ໥´«µÝ£¬ÏÖÔÚÎÒÃÇÀ´½øÈëʵ×÷½×¶Î£¬¿´¿´ÈçºÎ½«Ò»¸öCÓïÑÔ¿ª·¢µÄ¿ªÔ´mp3±à½âÂë¿âLAME°üװΪһ¸öPythonÏ¿ÉÒÔʹÓõÄÀ©Õ¹Ä£¿é¡£Ê×ÏÈÈ¥http://lame.sourceforge.net/download.phpÏÂÔØLAMEµÄÔ´´úÂ룬ȻºóÇл»µ½rootÓû§±àÒëÔ´´úÂ룬./configure
make
make instal ......

c µ÷Óà matlab engine ×Ô¶¨Ò庯Êý

ÉèÖãº
1. Tools/Projects and Solutions/VC ++ Directories
    Inlcude files: C:\Program Files\MATLAB\R2009a\extern\include
    Library files: C:\Program Files\MATLAB\R2009a\extern\lib
2. Property
    Configuration Properties/Linker
    ......

C/C++ ±ÊÊÔ¡¢ÃæÊÔÌâÄ¿´ó»ã×Ü£¨×ª£©

1.ÊDz»ÊÇÒ»¸ö¸¸ÀàдÁËÒ»¸övirtual º¯Êý£¬Èç¹û×ÓÀา¸ÇËüµÄº¯Êý²»¼Óvirtual ,Ò²ÄÜʵÏÖ¶à̬?
virtualÐÞÊηû»á±»ÒþÐμ̳еġ£private Ò²±»¼¯³É£¬Ö»ÊÂÅÉÉúÀàûÓзÃÎÊȨÏÞ¶øÒÑ¡£virtual¿É¼Ó¿É²»¼Ó¡£×ÓÀàµÄ¿Õ¼äÀïÓи¸ÀàµÄËùÓбäÁ¿(static³ýÍâ)¡£Í¬Ò»¸öº¯ÊýÖ»´æÔÚÒ»¸öʵÌå(inline³ýÍâ)¡£×ÓÀา¸ÇËüµÄº¯Êý²»¼Óvirtual ,Ò²ÄÜʵÏÖ¶àÌ ......

¹ØÓÚ¼òµ¥cµÄ´Ê·¨·ÖÎöÆ÷

Õâ¶ÎÔ´ÂëÄÜÔÚlinuxÏÂÔËÐУ¡£¡£¡ ÄÜʶ±ðСÊý
#include<unistd.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
/*#define  NULL          0*/
/*    ×Ô¶¨Òå±äÁ¿      */
#define&n ......

ÓÃC/C++³ÌÐò¿ØÖÆ»·¾³±äÁ¿

In C++, how do i go about using setenv to set the display?  I need to set it like this:
export DISPLAY=0.0
1¡¢setenv("DISPLAY",":0.1",1);
If you're calling the xrandr functions from your C++ program, then I would expect setenv() should work for you. The 3rd argument of 1 tells setenv() to ov ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ