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