20 lines
478 B
C
20 lines
478 B
C
#include "calculator.h"
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main() {
|
|
char infix[100], postfix[100];
|
|
printf("Zadajte matematický výraz: ");
|
|
fgets(infix, sizeof(infix), stdin);
|
|
|
|
// Konverzia na postfixovú notáciu
|
|
infix_na_postfix(infix, postfix);
|
|
printf("Postfixová notácia: %s\n", postfix);
|
|
|
|
// Vyhodnotenie výrazu
|
|
double vysledok = vyhodnot_postfix(postfix);
|
|
printf("Výsledok: %.2f\n", vysledok);
|
|
|
|
return 0;
|
|
}
|