0
已解决
朱宸晗
新手光能
新手光能
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
double a=3.00,b=2.50,c=4.50,d=9.50;
int main()
{
int n;
cin>>n;
if(n==1)
{
cout<<"[1] apples\n[2] pears\n[3] oranges\n[4] grapes\n[0] Exit\nprice=";
printf("%.1f",a);
}
else if(n==2)
{
cout<<"[1] apples\n[2] pears\n[3] oranges\n[4] grapes\n[0] Exit\nprice=";
printf("%.1f",b);
}
else if(n==3)
{
cout<<"[1] apples\n[2] pears\n[3] oranges\n[4] grapes\n[0] Exit\nprice=";
printf("%.1f",c);
}
else if(n==4)
{
cout<<"[1] apples\n[2] pears\n[3] oranges\n[4] grapes\n[0] Exit\nprice=";
printf("%.1f",d);
}
else if(n==0)
{
cout<<"";
}
else
{
cout<<"[1] apples\n[2] pears\n[3] oranges\n[4] grapes\n[0] Exit\nprice=";
cout<<0;
}
return 0;
}