注意:
(1)输出时注意是否为结果
(2)switch不要忘了写{}
include[HTML_REMOVED]
using namespace std;
int main()
{
int x,y;
double x1=4.00,x2=4.50,x3=5.00,x4=2.00,x5=1.50;
scanf(“%d%d”,&x,&y);
switch(x)
{
case 1:printf(“Total: R$ %.2f”,x1*y);break;
case 2:printf(“Total: R$ %.2f”,x2y);break;
case 3:printf(“Total: R$ %.2f”,x3*y);break;
case 4:printf(“Total: R$ %.2f”,x4y);break;
case 5:printf(“Total: R$ %.2f”,x5*y);break;
}
return 0;
}