📄 sa3109.c
字号:
#include "stdio.h"
#include "ctype.h" /* 必需用此头文件 */
void mix_up_the_chars(char line[]);
main()
{
char line[80];
printf(" str=");
scanf("%s",line);
mix_up_the_chars(line);
printf("new str=%s\n",line);
}
void mix_up_the_chars(char line[])
{
int index;
for (index = 0;line[index] != 0;index++)
{
if (isupper(line[index])) /* 检查是否为大写字母*/
line[index] = tolower(line[index]);
else
{
if (islower(line[index])) /* 检查是否为小字母 */
line[index] = toupper(line[index]);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -