weixin_41308065
cambriannn
2017-12-07 09:02

c语言怎样输出字符串?

  • c

请问这个程序为什么没法输出?

 #include<stdio.h>
void squeeze(char s1[],char s2[])
{
    int i, j, k = 0;;
    int DO =0;
    for (i = 0; s1[i] != '\0'; i++)
    {
        for(j = 0; s2[j] != '\0'; j++)
        {
            if (s1[i] == s2[j])
            {
                DO = 1;
            }
            if(!DO)
            {
                s1[k++] = s1[i];  
            }
        }
    }
    s1[j] = '\0';
}
int main()
{
    char s1[] = "4567yuljf";
    char c1[] = "ljf";
    squeeze(s1,c1);
    printf("%s",s1[1]);
}
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

3条回答