[ZJc079][UVA10346] Peter's Smokes
題目:
====================================================
#include<cstdio>
int main()
{
int a, b;
while (scanf("%d%d",&a,&b)!=EOF){
int sum = a;
while (a >= b){
sum += a / b ;
a = a / b + a % b;
}
printf("%d\n",sum);
}
return 0;
}
留言
張貼留言