| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
還是不能submit裏面打啊,白白搞了一次CErt
#include <stdio.h>
int main() {
while(1){
int n,k;
if(scanf("%d%d", &n, &k) != 2) break;
int t = 0;
int z = n, s = 0;
while(1){
t += z;
s += z;
z = s/k;
s = s%k;
if(!z) break;
}
printf("%d\n", t);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator