77 lines
1.5 KiB
C
77 lines
1.5 KiB
C
#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;
|
|
|
|
//}
|
|
|
|
//char hacker_script(char c){
|
|
// if (c == '5'){
|
|
// r == 'S';
|
|
// }
|
|
// return r;
|
|
//}
|
|
|
|
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(fgets(line, LINESIZE, stdin)){
|
|
velkost = strlen(line);
|
|
if (velkost == 1){
|
|
printf("%s", line);
|
|
break;
|
|
}
|
|
if(prvy==0){
|
|
|
|
|
|
|
|
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);
|
|
//}
|
|
|
|
|
|
// strcpy(pizz->name, line);
|
|
// if (matches(search_string, line)){
|
|
// printf("%s", pizza->name)
|
|
// }
|
|
//
|
|
|
|
|
|
|
|
return 0;
|
|
}
|