From 40cf04856bbc1f4a656a176110949a77ef6db403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Korpesio?= Date: Wed, 6 Oct 2021 18:43:24 +0200 Subject: [PATCH] skuska inputu --- cv1/program.c | 51 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 21 deletions(-) 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) + // } + // }