#include
#define N 10
//输入
char * enterCharacter();
char * enterCharacter(){
static char ary[N];
char *p=ary;
printf("input:");
for (int i=0; i
*(p+i)=getchar();
}
return p;
}
//处理
void dealWithCharaterAry(char *ptr);
void dealWithCharaterAry(char *ptr){
for (int i=0; i
if (*ptr>='a' && *ptr<='z') {
*ptr-=32;
}
if (*ptr>='A' && *ptr<='Z') {
*ptr+=32;
}
ptr++;
}
}
//输出
void printCharacter(char *ptr);
void printCharacter(char *ptr){
printf("result:");
for (int i=0; i
printf("%c",*ptr);
ptr++;
}
printf("\n");
}
int main(int argc, const char * argv[]) {
// insert code here...
char *ptr=enterCharacter();
dealWithCharaterAry(ptr);
printCharacter(ptr);
return 0;
}