From a11d84b3f898005beb65ca55b9871edd57500b0f Mon Sep 17 00:00:00 2001 From: Maksym Malko Date: Fri, 9 Oct 2020 11:08:16 +0200 Subject: [PATCH] First --- cv1/a.out | Bin 0 -> 7486 bytes cv1/program.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100755 cv1/a.out create mode 100644 cv1/program.c diff --git a/cv1/a.out b/cv1/a.out new file mode 100755 index 0000000000000000000000000000000000000000..f7ad0bb9d5e6c437bc4007ae715088d9f267ffeb GIT binary patch literal 7486 zcmb7Je{j^r72it^JP|H{s3?q{NF5I2y zw3~T(``P#Q?c29+_q*TkJ>qX#>~J`QE)}9u5bfFFbj<-Du2PaY!XsQ_y0}S96{FEa z*_^G=0m%;NGzx7_P$gx+bGAVax*C{78EunfVPB9rP6!hFi}6Y>+n#|8v=kjyfjBPZ z6<`+hEyzg2z$D5!28n%^Vr)_)FiFc+ePD$KuM%P~>vWNtAR}q{-H-!*sc8GRMI)`Z zMME>9kyv_@FBSLAQhni?oZFI>EwV5DWFHTRwkLrY8_GYqZvVqaj{UQ%cJ_x2Cp|}w z{bpI!Bb3nwToag{aD&PVrX_7rSKD`?ekF)YH3l>m#8_Sdq7Ln_AKSK0m+r{67w>$( zx4k96Axp}dA~X^8d&}^hW%$-IoG!z4WthI`;z6Zd18|P_lQLXWhGS)TOBr5YhHn7g zg>~i{OhAPF;QOA{7*fM%?}*2Ylod!?h9R)LK`!g-g48+<*B5kE0gPO47(fC8*q(~$qF{@3qwTB@J2BOh;kiDbfnCJ+1q{5cy zP>qHWv^o=Eqt&2_VQ_5Qk&XZiE@@h}sKJ=!n|-l1?_!N{sVMqWs1hwskORbZuar5Z z7y0T)1gYf|PeaDG>m;re&)ays#1FiQw=8jVC^yhb6xEbuF^fSbrMz!q{O<5qG6 zcsn@~Z6`UBe-}CW_mCq|pCCuF?j}dFK245<-$RbX{Utd(T$4HN%HM{8w)N$%7b2Uv zP$(33^jf3xo8eXFHP^a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p@c-t2yX;Nw<(N8h^O5e#No|XcbB1=Y3%; zX}W7seUow5;>BzH%|>(mq9#Ah$q(gN0KWk=uP`n}sd+^MW7HgI zjfT-}Q|;|OeB?J0LBlfBu?@b~O@bG1^$p+t9iXmGf5xv-KM52!*gqK*HyL=%$J>B% zC7nP3LSY!hZwl=q6%HhWru|byaVPbILU9XLqsSBdNKq;*`OO2mskmVVVj)he^k)w< z5Zr+DNClITgk}GXQEIB}SBuLC8CkA{`kkayq2$+;OQL!9PbHUHkYM2$me*d%wuE6m zgf+k`j@=}GGBK8KG*;U=-4G3=Qb=gSz`E(w;ezT6FI`UQVaZQ2mj<70|BiF1rAGW0 D*>0QJ literal 0 HcmV?d00001 diff --git a/cv1/program.c b/cv1/program.c new file mode 100644 index 0000000..8277c15 --- /dev/null +++ b/cv1/program.c @@ -0,0 +1,106 @@ +#include +#include +#include +#include +#define SIZE 100 + +struct pizza{ + float price; + char name[SIZE]; +}; + + +char hacker_script(char c); +int read_pizza(struct pizza* pizza1); +int search(char *needle, char* heap); +char* upgrade_string(char* param); + +int main(){ + puts("Zadaj hladanu surovinu:"); + char needle[SIZE]; + memset(needle,0,SIZE); + fgets(needle,SIZE,stdin); + needle[strlen(needle)-1]='\0'; + + struct pizza list[30]; + int index =0; + puts("Zadaj jedalny listok:"); + while(read_pizza(&list[index])){ + index++; + } + + for(int i =0;iname,SIZE,stdin)==NULL)return 0; + if(pizza1->name[0]=='\n'){ + return 0; + } + pizza1->name[strlen(pizza1->name)-1]='\0'; + + char* price = calloc(SIZE,sizeof(char)); + fgets(price,SIZE,stdin); + price[strlen(price)-1]='\0'; + + sscanf(price,"%f",&(pizza1->price)); + return 1; +} + + +char hacker_script(char c){ + char numbers[] = "0123456789"; + char letters[] = "oizeasbtbq"; + int i; + for (i = 0; i < 10; i++){ + if (c == numbers[i]){ + return letters[i]; + } + } + return 0; +} + + +int search(char *needle,char *heap){ + char* Needle = upgrade_string(needle); + char* Heap = upgrade_string(heap); + + int M = strlen(Needle); + int N = strlen(Heap); + for(int i =0;i<=N-M;i++){ + int j; + for(j=0;j