和原意有小的出入
帮忙改一下好吗?
谢谢
#include <stdio.h> main () { char ch; lop: printf("\nWelcome to use this program!\n"); printf("What do you want to do?\n"); printf("1.instruction 2.use the program 3.exit\n"); lp: ch=getchar(); switch(ch) { case '1': printf("THIS IS A SMALL PROGRAM MADE BY XH!THANK YOU FOR USING IT!"); getch(); goto lp; break; case '2': printf("Please input a key:");goto loop;break; case '3': printf("THANK YOU "); delay(100000000); exit(0); default : goto lop;break; } loop: printf("Please input a key:"); looop : ch=getchar(); if(ch!='\n') { switch(ch) { case '1':printf("MON\n");break; case '2':printf("TUE\n");break; case '3':printf("WED\n");break; case '4':printf("THU\n");break; case '5':printf("FRI\n");break; case '6':printf("SAT\n");break; case '7':printf("SUN\n");break; case '8':printf("THANK YOU FOR USING\n"); delay(100000000); exit(0); case '9':goto lop;break; default :printf("ERROR,please input it again\n");break; } goto loop; } else goto looop; getch(); }
使用编译器是WIN-TC
问题是很多东西重复用时PRINTF打印2遍
谢谢