test
This commit is contained in:
parent
3637255a09
commit
1f1de1a061
@ -8,11 +8,12 @@ int main() {
|
||||
char uloha[MAX_LINE_LENGTH];
|
||||
|
||||
while (fgets(uloha, MAX_LINE_LENGTH, stdin) != NULL) {
|
||||
|
||||
int cislo1, cislo2, vysledok_zadany;
|
||||
char operacia;
|
||||
|
||||
|
||||
while (getchar() != '\n');
|
||||
|
||||
if (sscanf(uloha, "%d %c %d = %d", &cislo1, &operacia, &cislo2, &vysledok_zadany) != 4) {
|
||||
printf("CHYBA\n");
|
||||
continue;
|
||||
@ -20,7 +21,6 @@ int main() {
|
||||
|
||||
double vysledok_skutocny;
|
||||
|
||||
|
||||
switch (operacia) {
|
||||
case '+':
|
||||
vysledok_skutocny = cislo1 + cislo2;
|
||||
|
Loading…
Reference in New Issue
Block a user