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

¼òµ¥µÄc³ÌÐò£¬±àÒë²»¹ý£¬ÇóÖú

Ô´´úÂëÈçÏ£¬ÎÒÕÒÁ˺ܾ㬾ÍÊDz»ÖªµÀ´íÔÚÄÄÁË¡£
ÇóÖ¸µã¡£
C/C++ code:

#include<stdio.h>
#include<stdlib.h>

#define OK 1
#define ERR 0

int p[8][8]={0};
int i = 0, j = 0;
int arr[8] = { 8,8,8,8,8,8,8,8 };

int solve(int (*t)[8]);
int pass(int t[8], int n);
int display(int (*arr)[8], int n);

int main()
{
solve(p);
display(p,8);
return 0;
}

int solve(int (*t)[8])
{
while (i++ != 7){
(*t)[i] = 1;
arr[j++] = i;
if (pass(arr,j))
sovle(t++);
else{
arr[--j] = 8;
(*t)[i] = 0;
}
}
}

int pass(int t[8], int n)
{
int a,b;
for (a = 1; a < n; a++)
for (b = 0; b < a; b++)
if (t[a] == t[b])
return ERR;
return OK;
}

int display(int (*arr)[8], int n)
{
int a,b;
for (a = 0; a < n; a++) {
for (b = 0; b < n; b++)
printf("%d\t",arr[a][b]);
printf("\n");
}
return 0;;
}

´íÎóÊÇʲô£¬³ö×ÔÄÄÒ»ÐУ¬Õâ¸öÕÒ³öÀ´ÁËÂð


int solve(int (*t)[8])º¯ÊýÌåÀï2¸ö´íÎó£¬Ò»¸öÊÇÆ´Ð´´íÎó£¬Ò»¸öÊÇȱ·µ»ØÖµ¡£

2¡¢3Â¥ÒѾ­ËµµÄºÜÇå³þÁË¡£lz»¹Óв»Ã÷°×µÄµØ·½Âð£¿

лл£¡£¡
ÎÒÒѾ­×öÁËÐ޸쬱àÒëͨ¹ý£¬µ«Êǵò»µ½ÎÒÒªµÄ½á¹û£¬Âé·³´ó¼Ò¿´¿´¡£

C/C++ code
{{---


Ïà¹ØÎÊ´ð£º

¸ß·ÖÇó!×îºÃÊÇC/C++ - C/C++ / CÓïÑÔ

·Ö±ðÓýṹ»¯·½·¨ºÍÃæÏò¶ÔÏó·½·¨±à³ÌʵÏÖÏÂÃæÒªÇó£º
¶ÔCircleºÍRectangleʵÏÖÒÔϹ¦ÄÜCenter,Move,Rotate,Print.
×Ô¼ºÏȶ©ÒÔÏ£¬ÕâÊÇÒ»¸ö¸Õѧϰ¼ÆËã»úµÄÈËÎÊÎÒµÄ


ѧϰ£¬¿´¿´

¼ÌÐø¶¥Å¶

ѧϰÁË¡£

go o ......

ÈçºÎÓÃC»­Í¼£¬ÄÜ·ñ±àÒ»¸ö¾ßÌåµÄ ¼±ÓÃ

ÈçºÎÓÃC»­Í¼£¬ÄÜ·ñ±àÒ»¸ö¾ßÌåµÄ ¡£
#include <conio.h>
#include <stdio.h>
int main()
{
int i;
char *s[]={"BLACK","BLUE","GREEN","CYAN","RE ......

VB µ÷Óà vc ±àдµÄdll - C/C++ / C++ ÓïÑÔ

ÓÃvc±àдµÄdllÔÚdebugģʽºÍreleaseģʽÏÂÆô¶¯vbµÄexe³ÌÐòµ÷ÓÃvcµÄdll¿ÉÒԵõ½ÕýÈ·½á¹û£¬µ«ÊÇÈç¹ûÖ±½ÓË«»÷vbµÄexe³ÌÐòµ÷ÓÃdll±¨´í£¬ÔÚdllÄÚ²¿Ìí¼Ómessageboxºó·¢ÏÖÖ»ÒªÔÚº¯ÊýÄÚ²¿ÉùÃ÷std::stringÀàÐ͵ıäÁ¿¾Í»á³öÏÖÄ ......

cÓïÑÔʵÏÖlinux timeÏà¹Øº¯Êý - C/C++ / CÓïÑÔ

ÏÖÔÚÐèÒªÔÚÒ»¸öǶÈëʽϵͳÖÐʵÏÖʱ¼äº¯Êý£¬±àÒëÆ÷δÌṩtime¿âº¯Êý£¬ÇëÎÊ´ó¼ÒÈçºÎÓÃcÓïÑÔʵÏÖʱ¼äº¯Êý°¡£¿
ÄêÔÂÈÕʱ·ÖÃë µ½ ÕûÊýÃ루´Ó1970Ä꿪ʼ£© Ö®¼äµÄÏà¹Ø×ª»»°¡
ÀàËÆmktime ºÍlocaltimeµÄ¹¦ÄÜ£¬Ð»Ð»
mktime ......

ÓÃC±àдָ¶¨¾ùÖµ·½²îµÄ¸ß˹ÔëÉù - C/C++ / CÓïÑÔ

¸øÒÑ֪ͼÏñÌí¼Ó¸ß˹ÔëÉù£¬ÇëÎʸß˹ÔëÉùÊÇÔõôʵÏֵģ¿¾ùÖµ·½²î·Ö±ðΪu£¬v¡£
½²Ò»ÏÂ˼·ҲÐа¡¡£¡£¡£¡£¡£¡£
csdn ¸ßÊÖÔÆ¼¯µÄµØ·½¡£¡£¡£¡£¡£¡£

http://zhidao.baidu.com/question/71224083.html

2Â¥¸øµÄÊÇÒ»¸ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ