caesar shift
c语言吧
全部回复
仅看楼主
level 1
禚和0Jb 楼主
don't know what's wrong#include
#include
int main( int argc,char*argv[]) { int num; int ret; char a; char c; printf("Please enter shift [0--25]:"); ret = scanf("%d",&num); if ( ret == 0 ) {printf("Input Error\n"); return 0; } assert(num>=0&&num<=25); getchar(); c=getchar(); while(c!=EOF){ if((c>='A')&&(c<='Z')){ c=c+num; if(c>90){ a=c-26; printf("%c",a); } } else if((c>='a')&&(c<='z')){ c=c+num; if(c>122){ a=c-26; printf("%c",a); } } else { printf("%c",c); } c=getchar(); } return 0;} 
2008年04月15日 01点04分 1
level 9
You should tell us the error information with it, or let's know what's the purpose of your program.
2008年04月15日 02点04分 2
level 0
caesar shift 就是凯撒加密法,就是移位替
2008年04月15日 03点04分 3
1