Cod sursa(job #2106795)
| Utilizator | Data | 16 ianuarie 2018 11:15:01 | |
|---|---|---|---|
| Problema | Rj | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 1.11 kb |
#include <fstream>
using namespace std;
ifstream fin("rj.in");
ofstream fout("rj.out");
const int N=102;
const int dl[]= {-1,0,1,0,1,-1,-1,1};
const int dc[]= {0,1,0,-1,1,-1,1,-1};
struct poz
{
int l,c;
};
int a[N][N],b[N][N];
int dR[N][N],dJ[N][N],n,m;
poz q[N][N];
char v[N];
int main()
{
int i,j;
poz r,ju;
char x;
fin>>n>>m>>ws;
for(i=1; i<=n; i++)
{
fin.getline(1+v,N);
//fin>>ws;
for(j=1; j<=m; j++)
{
x=v[j];
if(v[j]=='X')
{
a[i][j]=-2;
b[i][j]=-2;
}
else if(v[j]=='R')
{
a[i][j]=0;
b[i][j]=-1;
r=(poz)
{
i,j
};
}
else if(v[j]=='J')
{
a[i][j]=-1;
b[i][j]=0;
ju=(poz)
{
i,j
};
}
else
{
a[i][j]=-1;
b[i][j]=-1;
}
}
}
return 0;
}
