From 6717968d1e8942a1a534b599ea6bb71e4b187e2b Mon Sep 17 00:00:00 2001 From: Yaroslav Orlianskyi Date: Wed, 30 Mar 2022 22:45:48 +0200 Subject: [PATCH] SAD --- du4/test | Bin 0 -> 5764 bytes du4/test.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100755 du4/test create mode 100644 du4/test.c diff --git a/du4/test b/du4/test new file mode 100755 index 0000000000000000000000000000000000000000..db023eb1deb40f2f271db3472a02819551d89fac GIT binary patch literal 5764 zcmb7IeQcA*8Nb(Ys7HenzG+FpY7Gl5F@c4zA~Z}AJ_AW1fVytHIJOhJP3*{i9g-^2 z!W}jdw%zP+;h)+ckjLT&8q56hG7U@93oE;olQGk<*08?Rg!Yy5iU_87K&mq1x=Kd zcR~jw4PcayHYX^LGT`zbsctG?$3&h+|KC@=~x1V@z#hxGEUe)??YyF!) zyL;pwWe95`k8-@g_ClZ3!|-Gts6$@n&Lg{$eg0(o-v-f~Q`Xzi4Df3vVfxX<1Exv? z)YM-x2|o^e4Ef{Ort`&^W@B?aW+tsb!ZJ;PGzFQSRl?j_gVspjCwmdRue4_f)d&!RDX+4aJZ^qg7Q0gKF{PCVI=S;QV9WJhkoB(sP;MJOA&E-`zI zFvO8TiP>{x9`RX;89~HDd>VN9-}m?YHGONWwr*FX1-Xw1Jf7PddA-Z&8h#53|L)Hz zy~W-kd&9tMa94U7kM#JIgO0mH1Mn;`kdOBC+)m$_ch%{oFmwH#q5eK=u^1qd`WMF? zJ(n(ixX`$MV>|`JUrNJwwP8=C*Qt%)rSZANROnn!2O>37x_1qCAjB*AY%|`uJJits z!%i$AVv>n!%L4poq91V)#k?N^XUt6)DCMO#?SGw^eHy`0{Sr@ zhOgX{892)f9M_3pzIy7qJZY6WW8^*LsejbjKWg-kT$Q}h-+4hMQ&=8wGM(0(-a4y%x}jS2Z(=Hm!f>u3Sc38FS2 zIo&W#_v~Aq*}HrA_h>pa)Qnv&eW$p$$y?U?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7w%loeC9Afn*Z%Aon8gK@Y1TL0a_dV7~N}$<3DR F{lDENdi4MR literal 0 HcmV?d00001 diff --git a/du4/test.c b/du4/test.c new file mode 100644 index 0000000..66d3268 --- /dev/null +++ b/du4/test.c @@ -0,0 +1,57 @@ +#include +#include + +int main () +{ + int c, vysledok, i = 0; + int b[99]; + bool first = true; + bool second = false; + while(1){ + c = getchar(); + if(c <= 255 && c >= 0){ + if(c == '\n'){ + break; + }else if(c == ' '){ + continue; + }else if(c == '='){ + continue; + }else if(c == '+'){ + first = true; + second = true; + continue; + }else if(c == '-'){ + first = false; + second = false; + continue; + }else if(c == '/'){ + first = true; + second = false; + continue; + }else if(c == '*'){ + first = false; + second = true; + continue; + } + }else{ + if(i == 2) + break; + c = 0; + int r = scanf("%d",&c); + b[i++] = c; + } + } + if(first == true && second == true) + vysledok = b[0] + b[1]; + else if(first == false && second == false) + vysledok = b[0] - b[1]; + else if(first == true && second == false) + vysledok = b[0] / b[1]; + else if(first == false && second == true) + vysledok = b[0] * b[1]; + if(vysledok == b[2]) + printf("OK\n"); + else + printf("ZLE\n"); + return 0; +}