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

(a[i][j]+a[i][j+1]+a[i+1][j]+a[i+1][j+1]) /4 这一段您的a是字符型的,怎么能拿来除?

Posted by JiangLY at 2005-08-18 13:03:10 on Problem 2579
In Reply To:就回家了,帮看看吧,又是惹人的WA。(附代码) Posted by:Judas at 2005-08-18 08:33:55
> #include<iostream.h>
> #include<stdio.h>
> #include<string.h>
> 
> int main()
> {
> 	int m,n;
> 	int i;
> 	char a[10][10];
> 	char se[20];
> 	while(cin>>se)
> 	{		
> 		if(strcmp(se,"ENDOFINPUT")==0)	break;
> 		if(strcmp(se,"START")==0)	cin>>m>>n;				
> 		for(i=0;i<m;i++)	gets(a[i]);	cin>>se;
> 		if(strcmp(se,"END")==0)	
> 		for(i=0;i<m-1;i++)	
> 		{
> 			for(int j=0;j<n-1;j++)	
> 			{
> 				int d=(a[i][j]+a[i][j+1]+a[i+1][j]+a[i+1][j+1]) /4 -48; 
> 				cout<<d;
> 			}
> 			cout<<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