问题标题: 酷町堂:做的不对

0
0
已解决
林若城
林若城
修练者
修练者

题目链接: 酷町堂:1744

#include<iostream>
#include<iomanip>
using namespace std;
int main(){
    int a;
    cin>>a;
    if(a==1){
        cout<<setprecision(1)<<fixed<<"apples";
    }else{
        if(a==2){
            cout<<setprecision(1)<<fixed<<"pears";
        }else{
            if(a==3){
                cout<<setprecision(1)<<fixed<<"oranges";
            }else{
                if(a==4){
                    cout<<setprecision(1)<<fixed<<"Exit";
                }else{
                    cout<<"0";
                }
            }
        }
    }
    return 0;
}


0
已采纳
王梓轩
王梓轩
新手天翼
新手天翼

这个代码我看不太懂,不知道写的是什么东西。

思路:

输出:

[1] apples

[2] pears

[3] oranges

[4] grapes

[0] Exit

如果n=1输出"3.0"

如果n=2输出"2.5"

如果n=3输出"4.5"

如果n=4输出"9.5"

0
0
0
陈泽睿
陈泽睿
高级光能
高级光能

保留小数输出字符串??写的啥??你看题目了吗??

我要回答