求教!想要实现退出程序?
按“Y”表示退出,“N”想要实现继续判断的效果,可是没效果出来
#include"stdio.h" void main() { char quit='N'; while(quit=='N') { printf(" QUIT?\tPress Y or N.\n"); quit=getchar(); if(quit=='Y') break; if(quit=='N') { printf("Press any key to CONTINUE!\n"); getch(); } } }