题解 | 牛牛的快递

牛牛的快递

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

#include<iostream>
#include<cmath>
using namespace std;
int main(){
    double n;
    char c;
    cin >> n >> c;
    if(n<=1.0){
        if(c=='y'){
            cout << "25" << endl;
        }
        else{
            cout << "20" << endl;
        }
    }
    else{
        if(c=='y'){
            cout << ceil(n)-1+25;
        }
        else{
            cout << ceil(n)-1+20;
        }
    }
    return 0;
}

全部评论

相关推荐

菜菜狗🐶:双非之光
找工作,你会甘心进小厂还...
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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