A. Coins

Water.

 1 #include <bits/stdc++.h>
 2 using namespace std;
 3 int n, s;
 4 
 5 int main()
 6 {
 7     while (scanf("%d%d", &n, &s) != EOF)
 8     {
 9         int res = 0;
10         for (int i = n; i >= 1; --i) while (s >= i) 
11         {
12             ++res;
13             s -= i;
14         }
15         printf("%d\n", res);
16     }
17     return 0;
18 }
View Code

相关文章:

  • 2021-09-29
  • 2021-06-15
  • 2021-12-06
  • 2021-11-24
  • 2022-01-13
  • 2021-05-23
  • 2022-02-11
  • 2022-02-20
猜你喜欢
  • 2021-06-28
  • 2021-05-20
  • 2022-02-08
  • 2021-09-06
  • 2021-09-08
  • 2021-05-18
相关资源
相似解决方案