求助,字母加密的问题
程序代码:
开始选择加密或解密,加密:a-e,b-f....w-a,x-b每个字母向后推四个 解密相反 问题:为什么一直循环,无法退出(既没有执行exit(0);) 求高手指教,谢谢 #include "stdio.h" #include <stdlib.h> main() { int flag; char c; printf("enter flag,you can chose from 1 and 2,1 means jiami,2 means jiemi:"); abc: scanf("%d",&flag); if(flag==1) { printf("please input:"); do { scanf("%1c",&c); if(c=='w'||c=='x'||c=='y'||c=='z'||c=='W'||c=='X'||c=='Y'||c=='Z') { c=c-22; } else { c=c+4; } printf("%c",c); }while(c!='\n'); exit(0); } else if(flag==2) { printf("please input:"); do { c=getchar(); if(c=='a'||c=='b'||c=='c'||c=='d'||c=='A'||c=='B'||c=='C'||c=='D') { c=c+22; } else { c=c-4; } printf("%c",c); }while(c!='\n'); exit(0); } else { printf("error\nenter flag,you can chose from 1 and 2,1 means jiami,2 means jiemi:"); goto abc; } }