问题及代码
Description
输入字符串(长度20以内),将字符串中大写字母改为小写字母,其他字符不变,输出改变后的字符串。
Input
一个字符串(长度20以内)
Output
输出改变后的字符串(改变规则:将字符串中大写字母改为小写字母,其他字符不变)
Sample Input
ABC123bus
Sample Output
abc123bus
/*烟台大学计算机学院 2016
作者: 马春澎
完成日期:2016年12月9日 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char s[80];
int i;
gets(s);
for(i=0;s[i]!='\0';i++)
{
if(s[i]>='A'&&s[i]<='Z')
s[i]=s[i]+32;
}
puts(s);
return 0;
}
运算结果

知识点总结
字符串的简单应用
学习心得
注意输入字符串和输出字符串的用法,以及大小写字母之间相差的ASCLL值。