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

我终于知道下边这个程序一直compile error 在哪里了!!!!经历了二十多次compile error后!!!

Posted by scut_hcy at 2013-01-30 22:25:16 on Problem 2579
#include<iostream>//此程序我写,十多次compile error,改了n次,疯了,
                             //最后错误找出来了,是数组or命名不好,把or改成其他立刻ac
#include<cstring>
using namespace std;
int main()
{
	int or[15][15];
	int tr[15][15];
	char s[20];
	int m,n;
	while(cin>>s&&strcmp(s,"ENDOFINPUT"))
	{
		cin>>m>>n;
		int j,k;
		char c;
		for(j=1;j<=m;j++)
			for(k=1;k<=n;k++)
			{
				cin>>c;
				or[j][k]=c-'0';
			}
			cin>>s;
			for(j=1;j<=m-1;j++)
				for(k=1;k<=n-1;k++)
				{
					tr[j][k]=(or[j][k]+or[j][k+1]+or[j+1][k]+or[j+1][k+1])/4;
				}
				for(j=1;j<=m-1;j++)
				{
					for(k=1;k<=n-1;k++)
						cout<<tr[j][k];
					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