1 #include <stdio.h> 2 int main(int argc, const char *argv[]) 3 { 4 char s[64]={0}; 5 gets(s); 6 char *p=s; 7 while(*p) 8 { 9 if(*p<='z' && *p>='a'){ 10 *p=*p-'a'+'A'; 11 } 12 else if(*p<='Z' && *p>='A') 13 { 14 *p=*p-'A'+'a'; 15 } 16 else if(*p>=0 && *p<=9) 17 { 18 *p=0; 19 } 20 else{ 21 *p='-'; 22 } 23 p++; 24 } 25 printf("%s\n",s); 26 return 0; 27 }
标签:char,小写字母,else,大写字母,int,转为 From: https://www.cnblogs.com/xj123/p/17133149.html