问题描述:输入字符串(长度20以内),将字符串中大写字母改为小写字母,其他字符不变,输出改变后的字符串。
作者:李忠林
完成日期:2016.12.13
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
char a[21];
scanf("%s",&a);
for(i=0; a[i]!='\0'; i++)
{
if((a[i]>='A')&&(a[i]<='Z'))
{
printf("%c",a[i]+32);
}
else
printf("%c",a[i]);
}
return 0;
}
运行结果