| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
就回家了,帮看看吧,又是惹人的WA。(附代码)#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator