This commit is contained in:
Peter Petrek 2021-10-21 22:05:25 +02:00
parent 2473430d3a
commit 2eed7096b9

View File

@ -22,28 +22,28 @@ int main() {
databaza[counter].price = number; databaza[counter].price = number;
if(input[0] == '+'){ if(input[0] == '+'){
printf("%.2f\n",databaza[counter-2].price); printf("%.2f \n",databaza[counter-2].price);
printf("%.2f %.2f\n",databaza[counter-2].price, databaza[counter-1].price); printf("%.2f %.2f \n",databaza[counter-2].price, databaza[counter-1].price);
databaza[counter-2].price = databaza[counter-2].price + databaza[counter-1].price; databaza[counter-2].price = databaza[counter-2].price + databaza[counter-1].price;
printf("%.2f\n",databaza[counter-2].price); printf("%.2f \n",databaza[counter-2].price);
} }
if(input[0] == '-'){ if(input[0] == '-'){
printf("%.2f\n",databaza[counter-2].price); printf("%.2f \n",databaza[counter-2].price);
printf("%.2f %.2f\n",databaza[counter-2].price, databaza[counter-1].price); printf("%.2f %.2f \n",databaza[counter-2].price, databaza[counter-1].price);
databaza[counter-2].price = databaza[counter-2].price - databaza[counter-1].price; databaza[counter-2].price = databaza[counter-2].price - databaza[counter-1].price;
printf("%.2f\n",databaza[counter-2].price); printf("%.2f \n",databaza[counter-2].price);
} }
if(input[0] == '/'){ if(input[0] == '/'){
printf("%.2f\n",databaza[counter-2].price); printf("%.2f \n",databaza[counter-2].price);
printf("%.2f %.2f\n",databaza[counter-2].price, databaza[counter-1].price); printf("%.2f %.2f \n",databaza[counter-2].price, databaza[counter-1].price);
databaza[counter-2].price = databaza[counter-2].price / databaza[counter-1].price; databaza[counter-2].price = databaza[counter-2].price / databaza[counter-1].price;
printf("%.2f\n",databaza[counter-2].price); printf("%.2f \n",databaza[counter-2].price);
} }
if(input[0] == '*'){ if(input[0] == '*'){
printf("%.2f\n",databaza[counter-2].price); printf("%.2f \n",databaza[counter-2].price);
printf("%.2f %.2f\n",databaza[counter-2].price, databaza[counter-1].price); printf("%.2f %.2f \n",databaza[counter-2].price, databaza[counter-1].price);
databaza[counter-2].price = databaza[counter-2].price * databaza[counter-1].price; databaza[counter-2].price = databaza[counter-2].price * databaza[counter-1].price;
printf("%.2f\n",databaza[counter-2].price); printf("%.2f \n",databaza[counter-2].price);
} }
counter++; counter++;
} }