3800 买大米

#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,minn = 9999999; //公理:求最小值时,要初始化最大
    cin >> n;
    for(int i = 1; i <= n; i++) //循环n次
    {
        int a,b; //a公斤,b单价 
        cin >> a >> b;
        if(a * b < minn) //如果a * b比最小值minn小 
            minn = a * b; //更新最小值minn 
    } 
    cout << minn;
    return 0;
}

 

posted @ 2024-07-03 16:45  CRt0729  阅读(14)  评论(0编辑  收藏  举报