题解 | #牛牛的快递#

牛牛的快递

https://www.nowcoder.com/practice/41b42e7b3c3547e3acf8e90c41d98270

#include<iostream>
#include<iomanip>

using namespace std;
int main()
{
    float weight;
    int weight1,price,extraprice;
    char cha;
    cin>>weight>>cha;
    weight1=weight;
    if(cha=='y')
    {
        if(weight!=weight1&&weight>0)
        {
            cout<<int(weight1)+25;
        } 
        else cout<<int(weight1-1)+25;
    }
    if(cha=='n')
    {
        if(weight!=weight1&&weight>0)
        {
            cout<<int(weight1)+20;
        } 
        else cout<<int(weight1-1)+20;
    }
    return 0;
}

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务