2020-09-29 17:23:12 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#define LINESIZE 100
|
|
|
|
#define LINE_SIZE 100
|
|
|
|
|
|
|
|
struct pizza {
|
|
|
|
float prize;
|
|
|
|
char name[LINESIZE];
|
|
|
|
};
|
|
|
|
|
|
|
|
int main(){
|
|
|
|
int POCET_JEDAL=0;
|
|
|
|
struct pizza jedalny_listok[POCET_JEDAL];
|
|
|
|
// Na začiatku celé pole vynulujeme, všetky pizze sú nulové
|
|
|
|
memset(jedalny_listok, 0,sizeof(struct pizza)*POCET_JEDAL);
|
|
|
|
struct pizza *prva = jedalny_listok;
|
|
|
|
struct pizza *druha = jedalny_listok + 1;
|
|
|
|
struct pizza *tretia = &jedalny_listok[2];
|
|
|
|
int read_pizza(struct pizza* item);
|
|
|
|
|
|
|
|
char line[LINE_SIZE];
|
|
|
|
while (1){
|
|
|
|
// Inicializujem pamäť
|
|
|
|
memset(line,0,LINE_SIZE);
|
|
|
|
// Do poľa načítam max. LINE_SIZE znakov zo štandardnéhgo vstupu.
|
|
|
|
char* r = fgets(line,LINE_SIZE,stdin);
|
|
|
|
// Overím si či bolo načítanie úspešné.
|
|
|
|
if(r != NULL && line[1] != 0){
|
|
|
|
// Načítanie je úspešné ak fgets vráti nenulovú hodnotu a načítaný reťazec je dlhši ako jeden znak
|
|
|
|
printf("%s",line);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//printf("%s má cenu %.2f\n",item->name,item->prize);
|
|
|
|
char hacker_script(char c);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
char hacker_script(char c){
|
|
|
|
char numbers[] = "0123456789";
|
|
|
|
char letters[] = "oizeasbtbq";
|
|
|
|
for (int i = 0; i < 10; i++){
|
|
|
|
if (c == numbers[i]){
|
|
|
|
return letters[i];
|
|
|
|
}
|
|
|
|
}
|
2020-09-29 17:34:59 +00:00
|
|
|
}
|
|
|
|
//////////////////////
|
|
|
|
//////////////////////
|
|
|
|
//////////////////////
|
|
|
|
//////////////////////
|
|
|
|
//////////////////////
|
|
|
|
//////////////////////
|
|
|
|
//////////////////////
|
|
|
|
// //////////////////
|