1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
#include <stdio.h>
#include <string.h>
#include <iostream>
int main()
{
int i,j;
char poz[0];
printf("Enter the horizontal position of queen\n");
gets(poz);
if(poz=="A")
{
i=1;
}
else if (poz=="B")
{
i=2;
}
else if (poz=="C")
{
i=3;
}
else if (poz=="D")
{
i=4;
}
else if (poz=="E")
{
i=5;
}
else if (poz=="F")
{
i=6;
}
else if (poz=="G")
{
i=7;
}
else if (poz=="H")
{
i=8;
}
int chess[8][8]={
{1,2,3,4,5,6,7,8},
{1,2,3,4,5,6,7,8},
{1,2,3,4,5,6,7,8},
{1,2,3,4,5,6,7,8},
{1,2,3,4,5,6,7,8},
{1,2,3,4,5,6,7,8},
{1,2,3,4,5,6,7,8},
{1,2,3,4,5,6,7,8},
};
printf("%d", i);
}
|