题目描述
输入一个字符串,将字符串中所有非英文字母的字符删除后输出。
输入
多组测试数据,每组输入一个以回车结束的字符串。
输出
将这行字符中所有非英文字母的字符删除后输出
样例输入
I Have 2 MP3. please you declare the variable m_n_DLength10!
样例输出
IHaveMP pleaseyoudeclarethevariablemnDLength
#include<stdio.h>
#include<string.h>
int main(){
char str[100];
int i,j;
while(gets(str)){
for(i=0;str[i];i++){
if(str[i]<'a'||str[i]>'z'){
if(str[i]<'A'||str[i]>'Z'){
continue;
}
else{
printf("%c",str[i]);
}
}
else{
printf("%c",str[i]);
}
}
printf("\n");
}
return 0;
}