第1个回答 2012-11-29
先判断,如果它在 A~Z 之间,那加上48变为对应的小写字母;如果在 a~z 之间,那就减去48变为对应的大写字母,否则就不变
第2个回答 2012-11-29
char * strturn(char * res)
{
int i= 0;
while(res[i]!='\0')
{
if(res[i] >='A' && res[i] <='Z')
res[i]+= 32;
if(res[i] >='a' && res[i] <='z')
res[i]-= 32;
i++;
}
return res;
}
第3个回答 2012-11-29
void mytolower(char s[])
{
char *p = s;
while(*p)
if('A'<*p && *p<'Z')
*p = 'a' + *p-'A';
}