#include
#include
#include
#define MAX 10
int main(){
char n; //输入字符个数
char ch[MAX] ; //存放输入的字符
char b[MAX]; //存放ch中的小写字符
for (int i = 0; i < strlen(ch); i++)
{
scanf("%c",&n);
ch[i] = n;
if (ch[i] >= 'a' && ch[i] <= 'z' )
{
b[i] = ch[i];
}
}
for (int i = 0; i < strlen(b); i++)
{
printf("%c\t",b[i]);
}
system("pause");
return 0;
}
getchar()
放入A
然后
循环A
放入B即可
scanf("%s", &a);
n=strlen(a);
for(i=0, j=0; i
b[j++]=a[i];
}
}
b[j]=0;
printf("%s\r\n", b);