diff --git a/cv1/program.c b/cv1/program.c index 11be368..a0f4946 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -7,36 +7,45 @@ struct Pizza { char name[LINESIZE]; }; -int nacitaj(struct Pizza* polozka){ - return 0; - } -int matches(heap, needle){ - return 0; +//int matches(heap, needle){ +// return 0; -} -char r[LINESIZE]; -char hacker_script(char c){ - if (c == '5'){ - r == 'S'; - } - return r; -} +//} + +//char hacker_script(char c){ +// if (c == '5'){ +// r == 'S'; +// } +// return r; +//} int main (){ - char search_string[LINESIZE] = "Ostiepkova"; + size_t velkost = 0; + char line[LINESIZE]; + memset(line, 0, LINESIZE); + //char search_string[LINESIZE] = "Ostiepkova"; while(1){ char *r = fgets(line, LINESIZE, stdin); - if (r == NULL){ + velkost = strlen(line); + if (r == NULL || velkost == 1){ + printf("%s", line); break; } - struct Pizza pizza; - memset(line, 0, sizeof(struct Pizza)); - strcpy(pizz->name, line); - if (matches(search_string, line)){ - printf("%s", pizza->name) - } + struct Pizza pizza; + memset(line, 0,sizeof(struct Pizza)); + strcpy(pizza.name, line); + //if (matches(search_string. line)){ + // printf("%s", pizza->name); + //} + + + // strcpy(pizz->name, line); + // if (matches(search_string, line)){ + // printf("%s", pizza->name) + // } + // }