#include <stdio.h>
int hidden_message(const char *filename, const char delim){
    
    FILE *file = fopen(filename, "r");
    if(!file) return 1;


    int c = fgetc(file);
    if (c != EOF) putchar(c);
    //char *cara = c;

    while(c != EOF){

        c = fgetc(file);

        if( c == delim){
            while(c == delim) c = fgetc(file);
            
            if (c != EOF && c != delim)putchar(c);
        }
    }
    fclose(file);
    return 0;


}
/*
int main()
{
    hidden_message("example.txt", ':'); // Must return 0.
    // Must print nook

    putchar('\n');

    hidden_message("example.txt", ';'); // Must return 0.
    // Must print: n
    // Because no delimiter was found, so only the first character is printed

    putchar('\n');

    hidden_message("does_not_exist.txt", ':'); // Must return 1.
    // Must not print anything

    // FLAG
    //Decode the given message to understand what it means
    //
    hidden_message("flag.txt", '~');

    return 0;
}
*/
