upload
This commit is contained in:
parent
40cf04856b
commit
8c325a7f76
@ -1,13 +1,16 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#define LINESIZE 100
|
||||
|
||||
// Prepáčte za 0 bodov, moja chyba, uloha mi trvá viac času ako som plánoval, preto nestíham odovzdať zadanie správne. Ja pevne verím, že viac krát sa to už nezopakuje a ďalšie zadania už nebudú 0. Korpesio
|
||||
struct Pizza {
|
||||
float prize;
|
||||
char name[LINESIZE];
|
||||
};
|
||||
|
||||
|
||||
struct hladany {
|
||||
char item[LINESIZE];
|
||||
};
|
||||
//int nacitaj(struct pizza* item)
|
||||
//int matches(heap, needle){
|
||||
// return 0;
|
||||
|
||||
@ -24,18 +27,38 @@ int main (){
|
||||
size_t velkost = 0;
|
||||
char line[LINESIZE];
|
||||
memset(line, 0, LINESIZE);
|
||||
|
||||
char name[LINESIZE];
|
||||
int prvy = 0;
|
||||
char item[LINESIZE];
|
||||
struct hladany nazov;
|
||||
struct Pizza jedalny_listok;
|
||||
memset(nazov, 0,sizeof(struct hladany));
|
||||
memset(jedalny_listok, 0, sizeof(struct Pizza)*LINESIZE);
|
||||
int i = 0;
|
||||
//char search_string[LINESIZE] = "Ostiepkova";
|
||||
while(1){
|
||||
char *r = fgets(line, LINESIZE, stdin);
|
||||
while(fgets(line, LINESIZE, stdin)){
|
||||
velkost = strlen(line);
|
||||
if (r == NULL || velkost == 1){
|
||||
if (velkost == 1){
|
||||
printf("%s", line);
|
||||
break;
|
||||
}
|
||||
if(prvy==0){
|
||||
|
||||
struct Pizza pizza;
|
||||
memset(line, 0,sizeof(struct Pizza));
|
||||
strcpy(pizza.name, line);
|
||||
|
||||
|
||||
strcpy(nazov.item, line);
|
||||
|
||||
printf("%s", nazov.item);
|
||||
prvy++;
|
||||
}
|
||||
if (prvy %2! = 0){
|
||||
POCET_JEDAL++;
|
||||
|
||||
strcpy(jedalny_listok.name[i], line);
|
||||
printf("%s", jedalny_listok.name[i]);
|
||||
i++;
|
||||
}
|
||||
//if (matches(search_string. line)){
|
||||
// printf("%s", pizza->name);
|
||||
//}
|
||||
@ -46,7 +69,7 @@ int main (){
|
||||
// printf("%s", pizza->name)
|
||||
// }
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user