0
0

yukicoder No.2621 Fee Schedule 解説

Last updated at Posted at 2024-09-20

問題文

解説

答えは $\min(A\times C,B)$ となる。
このような数を求めるときは min関数を用いるとよい。

min(a,b)

このように書けば、 $a$ と $b$ のうち小さいほうを返してくれる。

解答例

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

int main() {
  int a,b,c;cin>>a>>b>>c;
  cout<<min(a*c,b)<<endl;
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0