Solution of URI 1010::Simple Calculate
Before seeing the solution make sure that you have tried enough. Don’t copy the whole code, just find out the logic. If you feel any problem, you will inform me by comment.
#include <stdio.h>
int main()
{
int pro1,pro2,unit1,unit2;
float price1,price2,total;
scanf("%d%d%f",&pro1,&unit1,& price1);
scanf("%d%d%f",&pro2,&unit2,& price2);
total=(unit1*price1) + (unit2*price2);
printf("VALOR A PAGAR: R$ %.2f\n",total);
return 0;
}
No comments