问题标题: 酷町堂:1744

0
0

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
王泽轩
王泽轩
资深天翼
资深天翼

yes,panyibuo  shuo de duiduiduiduiduidui

我要回答