22.3
This commit is contained in:
parent
fa132bcb27
commit
cdcb8a0bd4
@ -49,7 +49,7 @@ int main() {
|
|||||||
|
|
||||||
char op;
|
char op;
|
||||||
double num1, num2, result;
|
double num1, num2, result;
|
||||||
int scanned = sscanf(line, "%lf%c%lf=%lf", &num1, &op, &num2, &result);
|
int scanned = sscanf(line, "%lf %c %lf = %lf", &num1, &op, &num2, &result);
|
||||||
|
|
||||||
// Kontrola, či boli načítané správne hodnoty
|
// Kontrola, či boli načítané správne hodnoty
|
||||||
if (scanned != 4 || !is_operator(op) || !is_digit(line[0]) || !is_digit(line[len-2]) || line[len-3] != ' ')
|
if (scanned != 4 || !is_operator(op) || !is_digit(line[0]) || !is_digit(line[len-2]) || line[len-3] != ' ')
|
||||||
|
Loading…
Reference in New Issue
Block a user