1
已采纳
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;
switch(n){
case 0:
return 0;
case 1:
cout<<"price=3.0"<<endl;
return 0;
case 2:
cout<<"price=2.5"<<endl;
return 0;
case 3:
cout<<"price=4.5"<<endl;
return 0;
case 4:
cout<<"price=9.5"<<endl;
return 0;
default:
cout<<"price=0"<<endl;
}
return 0;
}
0
潘艺博
初级天翼
初级天翼
0