Friday, October 26, 2018

Uri 1010 solution in C | Simple Calculate

/*Before seeing the code solution make sure that you have tried enough. Don’t copy- paste the whole code. Find out the logic. If you face any trouble, just inform me in comment.*/

#include<stdio.h>
main()
{
    int c1,c2,a1,a2;
    float p1,p2,total;
    scanf("%d%d%f\n%d%d%f",&c1,&a1,&p1,&c2,&a2,&p2);
    //scanf("%f%f%f",&c1,&a2,&p2);
    total=(a1*p1)+(a2*p2);
    printf("VALOR A PAGAR: R$ %.2f\n",total);
    return 0;

}

//Happy_coding

No comments:

Post a Comment