题目大意:有两匹马,马可以走"日",也可以像象走"田",求它走到(1,1)的步数. 题解:bfs 卡点:边界判断成了可以走到(0,y)或(x,0) C++ Code: #include<cstdio> #include<cstring> using namespace std; const int maxn=51; int dx[12]={2,-2,2,-2,1,1,-1,-1,2,2,-2,-2}; int dy[12]={2,2,-2,-…
题目链接:https://www.luogu.com.cn/problem/P1427 题目大意: 给你一串数(输入到0为止),倒序输出这些数. 解题思路: 首先这道题目可以用数组存数据,然后输出. 实现代码如下: #include <bits/stdc++.h> using namespace std; int a[110], n; int main() { while (~scanf("%d", &a[n]) && a[n]) n ++; for…