题目描述
输入字符串(长度20以内),将字符串中大写字母改为小写字母,其他字符不变,输出改变后的字符串。
输入
一个字符串(长度20以内)
输出
输出改变后的字符串(改变规则:将字符串中大写字母改为小写字母,其他字符不变)
样例输入
ABC123bus
样例输出
abc123bus
解答:
#include <stdio.h> #include <stdlib.h> int main() { int i; char *p,s[20]; p=s; gets(s); for(i=0;i<20;i++,p++) { if(*p>='A'&&*p<='Z') *p=*p+32; } puts(s); return 0; }