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

请求指导

Posted by z286989429 at 2011-04-25 15:02:30 on Problem 2941
#include<stdio.h>
int p[1005][1005];

int main()
{   
	int n,i,j;
    int true=1;
	while(scanf("%d",&n)!=EOF){
		if(n==0)
			break;
		for(i=0;i<n;i++)
			for(j=0;j<n;j++)
				scanf("%d",&p[i][j]);
	      for(i=0;i<n-1;i++)
		  { for(j=0;j<n-1;j++)
				  if(p[i][j]+p[i+1][j+1]!=p[i+1][j]+p[i][j+1])
				  {  true=0; break;}
					  if(true==0)
						  break;}
	if(true==1)
		printf("homogeneous\n");
		else
			printf("not homogeneous\n");}
	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