level 3
ellison909
楼主
#include "stdafx.h"int Number=0;int _tmain(int argc, _TCHAR* argv[]){ TCHAR a;while(1){scanf("%c",&a);switch(a){case 'a':case 'A':Number++;break;case 'd':case 'D':Number--;break;case 's':case 'S': printf("The Number is %d.\n",Number);break;case 'o':case 'O': break;default: printf("Wrong command.\n");}if((a=='o')||(a=='O'))break;}getchar();return 0;}运行后,为什么我输入a,会打出Wrong command.??如下:aWrong command.sThe Number is 1.Wrong command.好象是输入函数的地方出现了问题。大哥,这是为什么呢?
2007年05月01日 03点05分
1