diff --git a/cv1/program.c b/cv1/program.c index f740b98..601e9d4 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -4,15 +4,15 @@ #include #define LINESIZE 100 -#define MENU_SiZE 100 +#define MENU_SIZE 100 -struct pizza{ +struct pizza { char name[LINESIZE]; float price; -} +}; -char hacker_script(char l){ - switch(tolower(char l)){ +char hacker_script(char l) { + switch (tolower(l)) { case 'o': return '0'; case 'i': return '1'; case 'z': return '2'; @@ -22,7 +22,7 @@ char hacker_script(char l){ case 'b': return '6'; case 't': return '7'; case 'q': return '9'; - default: return tolower(c); + default: return tolower(l); } } @@ -48,7 +48,6 @@ int read_pizza(struct pizza *item) { if (!fgets(item->name, LINESIZE, stdin)) { return 0; } - item->name[strcspn(item->name, "\n")] = '\0'; if (!fgets(line, LINESIZE, stdin)) { @@ -65,8 +64,9 @@ int main() { int count = 0; printf("Zadaj hladanu surovinu:\n"); + fgets(search, LINESIZE, stdin); - search[strcspn(search, "\n")] = '\0'; + search[strcspn(search, "\n")] = '\0'; printf("Zadaj jedalny listok:\n"); @@ -83,8 +83,8 @@ int main() { found_count++; } } - - printf("Nacitanych %d poloziek.\n", count);s + + printf("Nacitanych %d poloziek.\n", count); return 0; }