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呢,请教一下高手

Posted by xmut001 at 2009-06-12 09:54:03 on Problem 1552
#include<iostream>
using namespace std;
int main()
{
	int a[1000][16],i=0,j=0,k=0,m=0,sum[1000]={0},temp1;
	
	while( cin>>temp1 && temp1!=-1)
	{
       if(temp1==0)
	   {
		   i++;
		   j=0;
		   a[i][j]=11111;
		   continue;
	   }
	   a[i][j]=temp1;
		j++;

	}

	for(j = 0;j < i;j++)
		for(k = 0;k <16;k++)
			for(m=k;m<16;m++)
		{
			if(a[j][k]==11111)
				break;
			if(a[j][k]/a[j][m]==2 && a[j][k]%a[j][m]==0 ||a[j][m]/a[j][k]==2 && a[j][m]%a[j][k]==0)
				sum[j]++;
		}


		for(j = 0;j < i;j++){
		    cout<<sum[j]<<endl;
		}


	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