Computer Programming || Gaming || Technology || ai

URI Online Judge | 1038 Snack – Solve in C++


/****** Try Yourself First ********/

Solve in C++:

/

                        Online C Compiler.
            Code, Compile, Run and Debug C program online.

Write your code in this editor and press “Run” button to compile and execute it.

*/

include

int main()
{
int code,im;
scanf(“%d%d”,&code,&im);
if(code == 1)
{
float ans=4.00im; printf(“Total: R$ %.2f\n”,ans); } else if(code == 2) { float ans=4.50im;
printf(“Total: R$ %.2f\n”,ans);
}
else if(code == 3)
{
float ans=5.00im; printf(“Total: R$ %.2f\n”,ans); } else if(code == 4) { float ans=2.00im;
printf(“Total: R$ %.2f\n”,ans);
}
else if(code == 5)

{
float ans=1.50*im;
printf("Total: R$ %.2f\n",ans);
}

return 0;

}

You need to add a widget, row, or prebuilt layout before you’ll see anything here. 🙂

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *




Calender

October 2020
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031