1038 - Snack - URI Online Judge || URI Online Judge 1038 Snack Solution

Problem Name: Snack
Problem Code: 1038
Judge: URI Online Judge
Problem link: 1038 - Snack
Solution on GitHub: 1038 - Snack



URI Online Judge 1038 - Snack Solution in C++/Cpp

#include <iostream>


using namespace std;

int main()
{
    int x, y;
    cin >> x >> y;
    if (x == 1)
    {
        printf("Total: R$ %0.2f\n", y * 4.00);
    }
    else if (x == 2)
    {
        printf("Total: R$ %0.2f\n", y * 4.50);
    }
    else if (x == 3)
    {
        printf("Total: R$ %0.2f\n", y * 5.00);
    }
    else if (x == 4)
    {
        printf("Total: R$ %0.2f\n", y * 2.00);
    }
    else if (x == 5)
    {
        printf("Total: R$ %0.2f\n", y * 1.50);
    }

    return 0;
}

 

 


 

Next Post Previous Post
No Comment
Add Comment
comment url