Solution of 1038 number !
Please try by yourself first than check this one.
This is another way of solving the problem.
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main ()
{
int a,b;
cin >> a >>b ;
double c[5]={4.00,4.50,5.00,2.00,1.50};
double d=(double)(c[a-1]*b);
cout << "Total: R$ "<<fixed << setprecision(2)<< d <<endl;
return 0;
}
Please try by yourself first than check this one.
This is another way of solving the problem.
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main ()
{
int a,b;
cin >> a >>b ;
double c[5]={4.00,4.50,5.00,2.00,1.50};
double d=(double)(c[a-1]*b);
cout << "Total: R$ "<<fixed << setprecision(2)<< d <<endl;
return 0;
}
Comments
Post a Comment