| ||||||||||
| 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 | |||||||||
救急啊 怎么老是wrong answer 啊#include<stdio.h>
int main()
{
int a,b,m,sum=0;
scanf("%d%d",&a,&b);
if(a/b<b)
printf("%d\n",a);
else
sum=a;
if(a/b<b)
printf("%d\n",a+a/b);
else
{
do
{
m=a/b;
a=m;
sum=sum+a;
}while(m>=b);
printf("%d\n",sum);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator