Answer the question
In order to leave comments, you need to log in
Getting rid of the exponential notation of the response and simplifying the code
There is code that asks the user for a dollar amount and then prints the dollar equivalent in other currencies.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
setlocale(0,"");
const float funt = 1.487F;
const float frank = 0.172F;
const float marka = 0.584F;
const float iena = 0.00955F;
float dollar;
cout << "Введите кол-во долларов: ";
cin >> dollar;
cout << "фунт стерлингов" << setw(20) << std::setprecision(2) << dollar/funt
<< "\nфранц. франки" << setw(22) << std::setprecision(2) << dollar/frank
<< "\nнемецкая марка" << setw(21) << std::setprecision(2) << dollar/marka
<< "\nйена" << setw(31) << std::setprecision(2) << dollar/iena << endl;
system("pause");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question