Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

救急啊 怎么老是wrong answer 啊

Posted by tangmm729 at 2009-03-29 10:57:15 on Problem 2509
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator