C语言编程二维数组.docVIP

  • 5
  • 0
  • 约1.59千字
  • 约 3页
  • 2018-02-21 发布于河南
  • 举报
C语言编程二维数组

#includestdio.h #includetime.h #includestdlib.h void game1() { int temp=0; int guess; int count=3; bool judge=false; srand((unsigned)time(NULL)); temp=rand()%10; while((count0)(judge==false)) { printf(请输入所猜一维数组下标(1~10):); scanf(%d,guess); if(guess==temp) { printf(\n恭喜你!猜对了); judge=true; } else printf(\n很遗憾猜错了,还有%d次机会\n,count-1); count--; } } void game2() { int temp1=0; int temp2=0; int guess1; int guess2; int count=3; bool judge=false; srand((unsigned)time(NULL)); temp1=rand()%10; temp2=rand()%10; while((count0)(judge==false)) { printf(请输入二维数组的行下

文档评论(0)

1亿VIP精品文档

相关文档