[C.C++] 一串代码的人工审查

2308 1
鹰眼(流星) 2022-10-22 16:47:58 | 显示全部楼层 |阅读模式
各位好久不见!!!
    今天在家中接待客人,客人表态说自己太过无聊,我也没什么存货,决定造一个简易的小游戏,结果出现大BUG,我苦思冥想改了又改,找不到什么门路,只得询问个位大能的意见,没多难,也就这样:
  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <mycon.h>
  4. #include <windows.h>
  5. #include <time.h>

  6. int main(void)
  7. {
  8.         int goted[9][9];
  9.         int bac;
  10.         int red;
  11.         int cht;

  12.         srand((unsigned)time(NULL));

  13.         for(int a; a++; a <= 9)
  14.         {
  15.                 for(int b; b++; b <= 9)
  16.                 {
  17.                         goted[b][a] = bac % 2;
  18.                         bac = rand();
  19.                 }
  20.         }

  21.         for(int x = 0;x++;x <= 9)
  22.         {
  23.                 for(int y = 0;y++;y <= 9)
  24.                 {
  25.                                 gotoxy(0,0);
  26.                                 red = 0;
  27.                                 for(int m = x;m++;m <= 9)
  28.                                 {
  29.                                         for(int l = y;l++;l <= 9)
  30.                                         {
  31.                                                 printf("%d", goted[l][m]);
  32.                                                 red++;
  33.                                                 if(red == 10)
  34.                                                         goto L1;
  35.                                         }
  36.                                 }
  37.                                 L1:
  38.                                 for(int gag = 0;gag++;gag <= 10 && cht != 1)
  39.                                 {
  40.                                         cht = kbhit();
  41.                                         Sleep(25);
  42.                                 }

  43.                                 if(goted[y][x] != cht)
  44.                                         return 0;
  45.                 }
  46.         }
  47. }
复制代码
谢谢各位帮忙!!!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2025 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行