#include <iostream>
using namespace std;
const double rub = 80;
const double eur = 0.92;
int main()
{
double usd; int mode;
cout<<"Enter USD: ";cin>>usd;
cout<<"Convert to: 1 - RUB, 2 - EUR: ";cin>>mode;
if (mode == 1)
cout<<"RESULT: "<<usd*rub;
}
if (mode == 2)
cout<<"RESULT: "<<usd*eur;
return 0;
Объяснение:
#include <iostream>
using namespace std;
const double rub = 80;
const double eur = 0.92;
int main()
{
double usd; int mode;
cout<<"Enter USD: ";cin>>usd;
cout<<"Convert to: 1 - RUB, 2 - EUR: ";cin>>mode;
if (mode == 1)
{
cout<<"RESULT: "<<usd*rub;
}
if (mode == 2)
{
cout<<"RESULT: "<<usd*eur;
}
return 0;
}
Объяснение: