SDUT ACM 实验九 C语言实验——删除指定字符

来源:互联网 发布:汉森机器人 知乎 编辑:程序博客网 时间:2024/05/21 08:52
#include <stdio.h>
#include <string.h>


int main()
{
    char str[1005], y;
    int i, x;
    while(~scanf("%s %c",str,&y))
    {
        x = strlen(str);
        for(i = 0; i <= x - 1; i++)
        {
            if(str[i] == y)
                continue;
            else
                printf("%c", str[i]);
        }
        printf("\n");
    }
    return 0;
}
原创粉丝点击