View Code of Problem 3924

#include<stdio.h>
//参考前辈,数组的做法会越界,要放到主函数的外面
int main(){
    char ch,t;
    while ((ch=getchar())!=EOF){
        if (ch!=t){
            printf("%c",ch);
        }
        t=ch;
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 3924