0
已解决
何楷睿
高级守护
高级守护
#include<iostream> using namespace std; int main(){ int n; cout<<"[1] apples"<<endl; cout<<"[2] pears"<<endl; cout<<"[3] oranges"<<endl; cout<<"[4] grapes"<<endl; cout<<"[0] Exit"<<endl; cin>>n; if(n==0) return 0; if(n==1) { cout<<"price=3.0"<<endl; return 0; } if(n==2) { cout<<"price=2.5"<<endl; return 0; } if(n==3) { cout<<"price=4.5"<<endl; return 0; } if(n==4) { cout<<"price=9.5"<<endl; return 0; } cout<<"0"<<endl; return 0; }