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

Re:我刚学C,这个程序为什么会WRONG ANSWER??求助!!

Posted by zysaaa at 2010-11-25 14:07:33 on Problem 1942
In Reply To:我刚学C,这个程序为什么会WRONG ANSWER??求助!! Posted by:271855 at 2010-10-26 12:25:50
> #include<stdio.h>
> int main()
> {
> 	int n,m,i,a,works;
> 	while(1)
> 	{
> 		works=1;
> 		scanf("%d%d",&n,&m);
> 		if(n==0&&m==0)
> 			break;
> 			if(n>=m)
> 			{
> 			    a=n;
> 			    n=m;
> 			    m=a;
> 			}
>          for(i=0;i<n;i=i+1)
> 			{
> 				works=(works*(n+m-i))/(i+1);
> 			}
> 		printf("%d\n",works);
> 	}
> 	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