Initializacia
This commit is contained in:
parent
831b080f14
commit
d0d1dc2420
@ -4,15 +4,15 @@
|
||||
#include <string.h>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user