Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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(¶þ)

ÔÚÉÏһƪÖÐÎÒÃÇÒѾ­Ê¹ÓÃcÓïÑÔʵÏÖÁËÒ»¸ö×î¼òµ¥µÄÀ©Õ¹Ä£¿é£¬ÕâһƪÖн«ÔÚÆä»ù´¡ÉϽøÐй¦Äܵķḻ¡£Ê×ÏÈÀ´¿¼ÂÇÈçºÎ´ÓÍⲿµÄPythonÏòCÄ£¿é´«µÝ½ø²ÎÊý£¬foo_bar2չʾÁËÈçºÎÏòCÄ£¿é´«µÝÕûÊý£¬¸¡µãÊý£¬×Ö·û´®Èý¸ö²ÎÊý£¬ÆäÖÐ"ids"Ö¸Ã÷ÁË´«Èë²ÎÊýµÄÊý¾ÝÀàÐÍ¡£PyArg_ParseTuple¸ºÔð¶Ôargs½øÐнâÎö£¬Èô½âÎöʧ°ÜÔò·µ»Ø0.´úÂë#include&n ......

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µÄ´Ê·¨·ÖÎöÆ÷

Õâ¶ÎÔ´ÂëÄÜÔÚ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 ......

Îļþ´¦Àíº¯ÊýÈçºÎʹÓã¿Ó÷¨¾ÙÀý£¬CÓëMFC


CÓïÑÔ£¬ÓÐʱºòÕæ²»µÃ²»ÅåËü£¬ÕÕÀí˵£¬Îļþ´¦Àíº¯ÊýÊÇûÓÐʲôºÃ½²µÄ£¬µ«¶ÔÓںܶàCÈëÃŵÄÈËÀ´Ëµ£¬ËƺõÒ²ÊÇÖµµÃ¾²ÐÄÆ·Î¶Ò»·¬µÄ¡£
CÖеÄÎļþ´¦Àíº¯Êý²¢²»ºÜ¶à£¬¶ø³£Óõģ¬Ëƺõ¸üÉÙ¡£
º¯Êý²»ÄÑ£¬µ«²¢²»´ú±íÎļþ´¦ÀíÒ²²»ÄÑ¡£ËƺõÓÖÒªÓеãÅÜÌâÁË£¬ÎÒ×ÜÊÇϲ»¶ÅÜÌâ¡£Éϼ¸Ìì×öÃΣ¬Ãε½ÎÒµôµ½ÔÂÇòÉÏÈ¥À²……
¶ÔÎļþµ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ