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

WHATs wrong?????????????????????????????????????????????????????????????????

Posted by cxb23 at 2007-04-06 19:00:20 on Problem 3213
#include"stdio.h"
long a[1002][1002],b[1002][1002],c[1002][1002],camp;
main(){
	int i,j,k,m,p,n,judge=0;
	scanf("%d%d%d",&m,&p,&n);
	for(i=1;i<=m;i++){
		for(j=1;j<=p;j++){
			scanf("%ld",&a[i][j]);
		}
	}
	for(i=1;i<=p;i++){
		for(j=1;j<=n;j++){
			scanf("%ld",&b[i][j]);
		}
	}
	for(i=1;i<=m;i++){
		for(j=1;j<=n;j++){
			scanf("%ld",&c[i][j]);
		}
	}
	for(i=1;i<=m;i++){
		for(j=1;j<=n;j++){
			camp=0;
			for(k=1;k<=p;k++){
				camp+=a[i][k]*b[k][j];
			}
			if(camp!=c[i][j]){
				printf("No\n%d %d\n%ld\n",i,j,camp);
				return;
			}
		}
	}
	printf("yes\n");
}

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