TOPIC
Ajuda neste codigo
DevMoreira asked 6 years ago
Gente o sistema fala que nao ta dando certo com outras entradas. Porem eu teste e o codigo funciona. Nao to entendendo onde ta o erro do calculo. E a logica do programa ta ok.
include
include
include
using namespace std;
int main(){ int p, q; float CQ=4.50, XS=4.50, XB=5.00, TS=2.00, RF=1.50, T; cin >> p >> q; if (p==1){ T=qCQ; cout << fixed << setprecision(2) << "Total: R$ " << T << endl; }else if (p==2){ T=qXS; cout << fixed << setprecision(2) << "Total: R$ " << T << endl; }else if (p==3){ T=qXB; cout << fixed << setprecision(2) << "Total: R$ " << T << endl; }else if (p==4){ T=qTS; cout << fixed << setprecision(2) << "Total: R$ " << T << endl; }else if (p==5){ T=q*RF; cout << fixed << setprecision(2) << "Total: R$ " << T << endl; } return 0; }
This topic was solved and cannot recieve new replies.