Cho xinhgais

Tạo mảng hai chiều 8×8 a[100][100]xong gán cho nó bằng 0
Tạo 2 mảng 1 chiều h[100], c[100]
Nhập h[i], c[i]
Gán x= h[i], y=c[i]
Gán a[x][y] = 1;
Cho 1 vong for check xem di dung huong của quân mã không, nếu đúng thì gán check=1 nếu không gán check=-1 rồi break luôn.
Tạo biến sum=0
Nếu check =1 thì sum=sum+a[i][j];
Nếu check=-1 thì gán sum=-1;
 
  
Yes
haiyen223's text, translated to English


Create a 2 × 8 a 2 [100] [100] two-dimensional array, then assign it to 0
Create 2 arrays 1 dimensional h [100], c [100]
Enter h [i], c [i]
Assign x = h [i], y = c [i]
Assign a [x] [y] = 1;
Give 1 ring for check to see if the horse's code is used, if it is correct then assign check = 1 if not check = -1 then break.
Create the sum variable = 0
If check = 1 then sum = sum + a [i] [j];
If check = -1 then assign sum = -1;
Topic archived. No new replies allowed.