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:那位老兄帮忙看一下,为什么wrong answer

Posted by acmpku at 2005-01-06 21:12:49 on Problem 2051
In Reply To:那位老兄帮忙看一下,为什么wrong answer Posted by:acmpku at 2005-01-06 20:48:28
> #include<stdio.h>
> void main()
> {
> 	char a[1000][10];
> 	int i,k,t=0,m,n,b[1000],c[1000];
> 	for(i=0;i<1000;i++)
> 	{
> 		scanf("%s\n",a[i]);
> 		if(a[i][0]=='#')
> 			break;
> 		scanf("%d %d",&b[i],&c[i]);
> 	}
> 	scanf("%d\n",&k);
> 	for(m=1;;m++)
> 	{
> 		for(n=0;n<i;n++)
> 		{
> 			if(m%c[n]==0)
> 			{
> 				printf("%d\n",b[n]);
> 				t++;
> 			}
> 			if(t==k)
> 				break;
> 		}
> 		if(t==k)
> 			break;
> 	}
> }

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