CÓïÑÔµÄÒ»¸ö¼òµ¥Ëã·¨: 26¸ö×ÖĸËæ»ú²½Éú³É
Ò»¸ö¼òµ¥µÄС³ÌÐò, ÔÌâÄ¿¼û<CÓïÑÔ³ÌÐòÉè¼Æ-ÏÖ´ú·½·¨>µÚ°ËÕÂÁ·Ï°13.
ÓÉÓÚ×Ô¼ºÖ»¿´µ½µÚ°ËÕÂ, ËùÒÔ, ²»¸ÒóȻʹÓú¯ÊýµÈÆäËûÄÚÈÝ, ¸ßÊÖÇë·ÅÉù´óЦ.
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#define ROWS 10
#define COLS 10
/**
* @author: selfimpr
* @blog: http://blog.csdn.net/lgg201
* @email: lgg860911@yahoo.com.cn
* ¹¦ÄÜ:
* ROWS * COLSµÄ·½¸ñÖÐʵÏÖËæ»ú²½. ¼´½«26¸ö´óд×Öĸ°´Ë³ÐòÒÔËæ»úµÄ·½ÏòÅÅÁÐ.
* ÕâÀïʵÏÖµÄÊǰ˸ö·½Ïò(º¹, ²»ÖªµÀÓÐûÓа˸ö·½Ïòһ˵.)
* ȱÏÝ:
* Óнϴó¼¸Âʱ»À§ËÀ, ûÓÐ×öÓÅ»¯´¦Àí.
* Êý¾Ý½á¹¹Éè¼Æ:
* 1. ROWS, COLSºê¶¨ÒåÁËÆåÅ̵ĴóС
* 2. board¶þάÊý×鶨ÒåÁËÆåÅÌ, ûÓÐ×ÖĸµÄÒÔ.ºÅ²¹¿Õ
* 3. i, jΪѻ·Òò×Ó, ÔÚ·½Ïò¿ØÖÆʱ, ³äµ±ÁËÒƶ¯µÄ·½Ïò¿ØÖÆ.
* 4. directionΪ·½Ïò¿ØÖƱäÁ¿.
* 5. chÊÇ˳Ðò»ñÈ¡×ÖĸµÄÑ»·Òò×Ó.
* 6. row, col´æ´¢ÁÙʱµÄÒƶ¯×ø±ê, ´æ´¢¸Ã×ø±êΪÁ˱£Ö¤»ñÈ¡µÄ·½Ïò²»¿ÉÓÃʱ, ²»Ó°ÏìÔÊý¾Ý.
* Á÷³Ì:
* 1. ³õʼ»¯ÆåÅÌ, ÒÔ.ºÅ³õʼ»¯ËùÓÐÔªËØ, ´òÓ¡Ò»´Î¿ÕÆåÅ̺ó, ½«ÆåÅÌ[0, 0]×ø±êÔªËØÉèÖÃΪ'A'.
* 2. ÉèÖÃËæ»úÊýÉú³ÉÖÖ×ÓΪµ±Ç°Ê±¼ä, ÒÔ±£Ö¤Ã¿´ÎÉú³ÉµÄËæ»úÊý²»Í¬.
* 2. Ñ»·´¦Àí×Öĸ
* 3. »ñÈ¡Ëæ»ú·½Ïò, ²¢¸ù¾Ý·½ÏòÈ¡µÃÒƶ¯ºóµÄ×ø±ê, ±£´æµ½ÁÙʱ±äÁ¿rowºÍcolÖÐ.
* 4. ÅжÏеÄ×ø±êÊÇ·ñÓÐЧ
* 5. Èç¹ûÐÂ×ø±ê²»¿ÉÓÃ, µ½µÚ3²½ÖØлñÈ¡·½Ïò.
* 6. Èç¹ûÐÂ×ø±êÓÐЧ:
* 6.1. ÉèÖÃÆåÅ̶ÔӦλÖõÄ×Öĸ
* 6.2. ½«ÁÙʱ×ø±êÐÅϢת´æµ½ÕæÕýµÄµ±Ç°×ø±êi, jÖÐ.
* 6.3. »ñÈ¡ÏÂÒ»¸ö×Öĸ
* 6.4. µ½µÚ2²½ÖØпªÊ¼´¦ÀíÏÂÒ»¸ö×Öĸ.
* 7. ´òÓ¡×îºóÉú³ÉµÄÆåÅÌ.
*
*/
int main() {
char board[ROWS][COLS];
int i, j, direction;
srand( (unsigned) time(NULL));
for(i = 0; i < ROWS; i ++) {
for(j = 0; j < COLS; j ++) {
board[i][j] = '.';
}
}
for(i = 0; i < ROWS; i ++) {
for(j = 0; j < COLS; j ++) {
printf("%c ", board[i][j]);
}
printf("\n");
}
board[0][0] = 'A';
printf("\n");
char ch;
i = 0; j = 0;
int row = 0, col = 0;
for(ch = 'B'; ch <= 'Z';) {
direction = rand() % 8;
switch(directio
Ïà¹ØÎĵµ£º
11¡¢ÏÂÃæµÄ´úÂëÊä³öÊÇʲô£¬ÎªÊ²Ã´£¿
Void foo(void)
{
unsigned int a = 6;
int b = -20;
(a+b > 6) £¿puts("> 6") : puts("<= 6");
}
²»¹ÜÈçºÎ£¬ÕâÎÞ·ûºÅÕûÐÍÎÊÌâµÄ´ð°¸ÊÇÊä³öÊÇ“>6”¡£ÔÒòÊǵ±±í´ïʽÖдæÔÚÓзûºÅÀàÐͺÍÎÞ·ûºÅÀàÐÍʱËùÓеIJÙ×÷Êý¶¼×Ô¶¯×ª»»ÎªÎÞ·ûºÅÀàÐÍ¡£Òò´Ë-20±ä³ÉÁËÒ»¸ ......
ÉÏѧÆÚ¼ä»ù±¾É϶¼ÔÚwindowsϱà³Ì£¬¾ÍÊÇѧÁËÒ»µãLINUX£¬Ò²ÊÇһЩ»ù±¾²Ù×÷£¬ÔÚLINUXϱà³Ì¼¸ºõûÓйý£¬ÉÏ°àºó¶¼ÊÇÔÚUNIXϵĿª·¢£¬Í»È»Ö®¼äÓеã¸Ð¾õ×Ô¼ºÎÞ´¦ÏÂÊÖ£¬¸Ð¾õ²»»áÁË£¬×鳤ÈÃÎÒ±àÒ»¸ö³ÌÐò£¬ÎÒÏëÁË°ëÌìÔÚÍøÉϲéÁË°ëÌ죬Óеã˼·ÁË£¬ÔÚ±àÒëʱȷʵ´íÎóÁ¬Á¬£¬¸Ð¾õ¶¼ºÜÓÐѹÁ¦£¬µ«ÎÒ»áÂýÂýÏ°¹ßµÄ£¬ÎÒÏàÐÅ×Ô¼º¡£
ÎÊÌ⣺
1 ......
µ÷Óú¯Êýʱ£¬¼ÆËã»ú³£ÓÃÕ»À´´æ´¢´«µÝ¸øº¯ÊýµÄ²ÎÊý¡£
Õ»ÊÇÒ»ÖÖÏȽøºó³öµÄÊý¾Ý½á¹¹£¬Õ»ÓÐÒ»¸ö´æ´¢Çø¡¢Ò»¸öÕ»¶¥Ö¸Õë¡£Õ»¶¥Ö¸ÕëÖ¸Ïò¶ÑÕ»ÖеÚÒ»¸ö¿ÉÓõÄÊý¾ÝÏ±»³ÆΪջ¶¥£©¡£Óû§¿ÉÒÔÔÚÕ»¶¥ÉÏ·½ÏòÕ»ÖмÓÈëÊý¾Ý£¬Õâ¸ö²Ù×÷±»³ÆΪѹջ(Push)£¬Ñ¹Õ»ÒÔºó£¬Õ»¶¥×Ô¶¯±ä³ÉмÓÈëÊý¾ÝÏîµÄλÖã¬Õ»¶¥Ö¸ÕëÒ²ËæÖ®Ð޸ġ£Óû§Ò²¿ÉÒÔ´Ó¶ÑÕ»ÖÐ ......
CÓïÑÔÖÐÐí¶à·ûºÅÊDZ»“ÖØÔØ”µÄ£¬ÓÐЩ¹Ø¼ü×ÖÒ²±»ÖØÔضø¾ßÓкü¸ÖÖÒâÒ壬ֵµÃ×¢ÒâµÄ¼¸¸ö·ûºÅÈçÏ£º
·ûºÅ ÒâÒå
static ÔÚº¯ÊýÄÚ²¿£¬±íʾ¸Ã±äÁ¿µÄÖµÔÚ¸÷¸öµ÷ÓüäÒ»Ö±±£³ÖÑÓÐøÐÔ
ÔÚº¯ÊýÕâÒ»¼¶£¬±íʾ¸Ãº¯ÊýÖ»¶Ô±¾Îļþ¿É¼û
extern ÓÃÓÚ ......
µÚÒ»´Î×ÐϸµØ¿´ÕâÖÖ´úÂ룬¶¼ÊÇ´ÓÍøÉϸ´ÖÆ×öÁËÂÔ΢¸Ä¶¯ºóµÄ²úÎï¡£´úÂëÈçÏ£º
#include "reg52.h"
unsigned char Count;
sbit Xiang=P1^2 ; //·äÃùÆ÷Ïì
unsigned char code SONG[] ={
0x26,0x20,0x20,0x20,0x20,0x20,0x26,0x10,0x20,0x10,0x20,0x80,0x26,0x20,0x30,0x20,
0x30,0x20,0x39,0x10,0x30,0x10,0x30,0x80,0x2 ......