commit 2def5df9e8eeae209bacfd922b74be2770da4f44 Author: Michaela Šaková Date: Mon Mar 25 16:09:05 2019 +0100 test diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..70bdd14 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +git: + git add . + git commit -am "test" + git push diff --git a/program b/program new file mode 100755 index 0000000..3172979 Binary files /dev/null and b/program differ diff --git a/program.c b/program.c new file mode 100644 index 0000000..3b38d5e --- /dev/null +++ b/program.c @@ -0,0 +1,42 @@ +#include + +int main(){ + float a,b,v; + int o,p; + scanf("%f",&a); + while((o=getchar())==' '){ + } + scanf("%f",&b); + while((p=getchar())==' '||(p=getchar())=='='){ + } + scanf("%f",&v); + switch(o){ + case '+':if(v==(a+b)){ + printf("OK\n"); + }else{ + printf("ZLE\n"); + } + break; + case '-':if(v==(a-b)){ + printf("OK\n"); + }else{ + printf("ZLE\n"); + } + break; + case '*':if(v==(a*b)){ + printf("OK\n"); + }else{ + printf("ZLE\n"); + } + break; + case '/':if(v==(a/b)&&b!=0){ + printf("OK\n"); + }else{ + printf("ZLE\n"); + } + break; + default: printf("CHYBA\n"); + break; + } +return 0; +}