|
楼主 |
发表于 2006-7-7 13:15
|
显示全部楼层
我的部分程序如下
- main()
- {char c1,c2,c3,c4;
- while(1)
- {
- printf("\n\n Welcome!!\n\n");
- printf(" a. 皇后问题\n");
- printf(" b. 插入排序\n");
- printf(" c. 泡沫排序\n");
- printf(" d. 哈希排序\n");
- printf(" e. 退出\n");
- loop:printf("\n请输入指令:");
- scanf("%c",&c1);
- scanf("%c",&c2);
- switch(c1)
- {case 'a':huanghou();break;
- case 'b':insertsort();break;
- case 'c':maopao();break;
- case 'd':Hash();break;
- case 'e':goto loop2;
- default :printf("\n\n 输入错误.\n\n请选择 a, b, c ,d or e\n");goto loop;
- }
- loop1:printf("\n Menu or Quit ?(mm/qq)\n");
- scanf("%c",&c3);
- scanf("%c",&c2);
- if(c3=='q'||c3=='Q') goto loop2;
- else if(c3=='m'||c3=='M') {system("cls");continue;}
- else printf("\n\n Bad input!!\n");goto loop1;
- }
- loop2:printf("\n\n Good bye!!\n\n");
- scanf("%c",&c2);
- system("cls");
- }
复制代码
出现楼上的情况!奇怪!多按几次就实现了! |
|