输入一个字符串放在数组a中,把a数组中所有大小写字母存放数组b中,构成新的字符串

2024-11-19 07:29:59
推荐回答(1个)
回答(1):

int a[22] = {0};
int b[22] = {0};
scanf("%s",a);
int i = 0;
while(a[i] != '\0')
{
if((a[i]>='A' && a[i]<='Z') || (a[i]>='a' && a[i]<='z'))
b[i] = a[i];
i++;
}
printf("%s\n",b);