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 |
怎么回事会WA,还有什么情况没有考虑到???是不是数据精度不够?#include <stdio.h> int main() { int n,k,sum; scanf("%d %d",&n,&k); do { sum = n; while(n/k) { sum +=(n /=k); } printf("%d\n",sum); }while(scanf("%d %d",&n,&k)!=EOF); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator