Monday, June 22, 2020

URI 1010 Solution- Brain Muscles URI 1010 Solution In C

Posted By: Naeem - June 22, 2020

Share

& Comment


URI Online Judge Solution 1010 - Brain Muscles URI 1010
URI Online Judge Solution 1010☺ Simple Calculate☺ URI Online Judge Solution 1010
Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.

URI Online Judge Solution 1010 - Brain Muscles URI 1010 Solution In C
Add caption

URI Online Judge | 1010
Simple Calculate

 

In this problem, the task is to read a code of a product 1, the number of units of product 1, the price for one unit of product 1, the code of a product 2, the number of units of product 2 and the price for one unit of product 2. After this, calculate and show the amount to be paid.

Input

The input file contains two lines of data. In each line there will be 3 values: two integers and a floating value with 2 digits after the decimal point.

Output

The output file must be a message like the following example where "Valor a pagar" means Value to Pay. Remember the space after ":" and after "R$" symbol. The value must be presented with 2 digits after the point.

Samples Input
Samples Output
12 1 5.30
16 2 5.10
VALOR A PAGAR: R$ 15.50
13 2 15.30
161 4 5.20
VALOR A PAGAR: R$ 51.40

1 1 15.10

2 1 15.10


VALOR A PAGAR: R$ 30.20




URI Solution 1010 Simple Calculate Solution in C:





#include<stdio.h>
int main()
{
   int P1,P2,U1,U2;
    double PP1,PP2,TOTAL;
    scanf("%d %d %lf",&P1,&U1,&PP1);
    scanf("%d %d %lf",&P2,&U2,&PP2);
    TOTAL=(U1*PP1)+(U2*PP2);
    printf("VALOR A PAGAR: R$ %.2lf\n",TOTAL);
  return 0;
}     
                  

About Naeem

Techism is an online Publication that complies Bizarre, Odd, Strange, Out of box facts about the stuff going around in the world which you may find hard to believe and understand. The Main Purpose of this site is to bring reality with a taste of entertainment

0 comments:

Post a Comment

URI 1010 Solution- Brain Muscles URI 1010 Solution In C

URI Online Judge Solution 1010 - Brain Muscles URI 1010 URI Online Judge Solution 1010☺ Simple Calculate☺ URI Online Judge Solution 101...

Copyright © Brain Muscles™ is a registered trademark.

Designed by Templateism. Hosted on Blogger Platform.