[ZJc079][UVA10346] Peter's Smokes
題目: http://zerojudge.tw/ShowProblem?problemid=c079 ==================================================== #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; }