-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove gcov_report from goals, fixed codestyle, changed test.sh from …
…cmake to make build system
- Loading branch information
1 parent
fa8cab5
commit 955d723
Showing
13 changed files
with
292 additions
and
2,947 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
#include "back/calc.h" | ||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
#include "back/calc.h" | ||
|
||
int main() { | ||
char expression[MAX_SIZE] = {0}; | ||
char expression[MAX_SIZE] = {0}; | ||
|
||
printf("\nEnter expression to calculate\n---> "); | ||
fgets(expression, MAX_SIZE, stdin); | ||
|
||
printf("\nEnter expression to calculate\n---> "); | ||
fgets(expression, MAX_SIZE, stdin); | ||
double var = 0; | ||
int length = strlen(expression); | ||
|
||
double var = 0; | ||
int length = strlen(expression); | ||
// Delete '\n' from expression | ||
if (expression[length - 1] == '\n') { | ||
expression[length - 1] = '\0'; | ||
} | ||
|
||
// Delete '\n' from expression | ||
if (expression[length - 1] == '\n') { | ||
expression[length - 1] = '\0'; | ||
} | ||
int size = 0; | ||
token *infix = parse_str(expression, &size); | ||
token *postfix = to_polish(infix, size); | ||
|
||
int size = 0; | ||
token *infix = parse_str(expression, &size); | ||
token *postfix = to_polish(infix, size); | ||
// If 'x' present in expression and expression is correct, read 'x' value | ||
if (size && strchr(expression, 'x')) { | ||
printf("\nEnter variable\n---> "); | ||
scanf("%lf", &var); | ||
} | ||
|
||
// If 'x' present in expression and expression is correct, read 'x' value | ||
if (size && strchr(expression, 'x')) { | ||
printf("\nEnter variable\n---> "); | ||
scanf("%lf", &var); | ||
} | ||
double res = calc(postfix, var, size); | ||
|
||
double res = calc(postfix, var, size); | ||
free(infix); | ||
free(postfix); | ||
|
||
free(infix); | ||
free(postfix); | ||
printf("Result = %f\n", res); | ||
|
||
printf("Result = %f\n", res); | ||
|
||
return 0; | ||
return 0; | ||
} |
Oops, something went wrong.