ACM寒假集训
程序员文章站
2024-03-20 13:33:46
...
题目链接:https://vjudge.net/contest/279620#problem/C
代码:
#include <iostream>
using namespace std;
int main()
{
int a, b,i,sum;
cin >> a >> b;
sum = a;
if (a < 1 || a>1000 || b < 2 || b>1000)
return 0;
for (i = 0; i >= 0; i++)
{
a = a - b;
if (a < 0)
break;
a = a + 1;
}
sum = sum + i;
cout << sum;
}
上一篇: 9.10NOIP模拟赛
下一篇: 购物车的简单实现