我的答案

#include<bits/stdc++.h>
using namespace std;
int n;
struct hhh
{
    int num;
    int money;
}a,b,c;
int main()
{
    int min;
    cin>>n;
    cin>>a.num>>a.money>>b.num>>b.money>>c.num>>c.money;
    int agreat=0,bgreat=0,cgreat=0;
    while(agreat*a.num<n)
        agreat++;
    while(bgreat*b.num<n)
        bgreat++;
    while(cgreat*c.num<n)
        cgreat++;
    agreat*=a.money;
    bgreat*=b.money;
    cgreat*=c.money;
    min=(agreat<bgreat)?((agreat<cgreat)?agreat:cgreat):((bgreat<cgreat)?bgreat:cgreat);
    cout<<min;
}
全部评论

相关推荐

测试糕手手:社会第一课,随便吹牛逼,直接说四个月,别老实。老实人只会被欺负
点赞 评论 收藏
分享
06-25 09:33
厦门大学 Java
程序员饺子:现在日常估计没啥hc了,等到八月多估计就慢慢有了。双九✌🏻不用焦虑的
投递快手等公司7个岗位
点赞 评论 收藏
分享
每晚夜里独自颤抖:要求太多的没必要理
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-09 12:23
转人工😡
门口唉提是地铁杀:五次握手了
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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