| ||||||||||
| 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>
using namespace std;
void main()
{
int nKey[102][12];
memset((void*)nKey,0, 4*102*12);
int m, n, i, j, nCount;
nCount = 0;
cin >> m >> n;
for(i=0; i<m; i++)
{
char szTmp[10];
cin >> szTmp ;
for(j=0; j<n; j++)
{
if(szTmp[j]=='P')
{
if (nKey[i][j]==0)
{
nCount ++;
nKey[i+1][j] = 1;
nKey[i+2][j] = 1;
nKey[i][j++] = 1;
nKey[i][j++] = 1;
}
}
}
}
printf("%d\n", nCount );
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator