问题及代码:
烟台大学计算机与控制工程学院
作者:毕春超
完成日期:2016年12月12日
题目描述
输入字符串(长度20以内),将字符串中大写字母改为小写字母,其他字符不变,输出改变后的字符串(改变规则:将字符串中大写字母改为小写字母,其他字符不变)
#include <stdio.h>
int
main()
{
char
a[20];
int
i;
gets
(a);
for
(i=0;a[i]!=
'\0'
;i++)
{
if
(a[i]>=
'A'
&& a[i]<=
'Z'
)
a[i]=a[i]+32;
}
puts
(a);
return
0;
}
运算结果