解题思路:库函数<ctype.h>的使用
注意事项:
参考代码:
#include <stdio.h>
#include <ctype.h>
#include <string.h>
void change(char* p)
{
char* s = p;
for (int i = 0; i < strlen(s); i++)
{
if (islower(*p))
*p = toupper(*p);
else
*p = tolower(*p);
p++;
}
puts(s);
}
int main(void)
{
char ch[21];
gets(ch);
change(ch);
return 0;
}
0.0分
0 人评分