package exp2; /* * 本类实现反对角方式的方阵遍历: */ public class AntiDiagonal extends SquareTraversal{ public AntiDiagonal(int size) { initiate(size); } @Override public SquarePoint getInitPoint() { return new SquarePoint(0, 0); } @Override public SquarePoint getNext() { // Add your code here } } // 文件SquareTraversalApplication.java
时间: 2023-06-01 20:01:58 浏览: 82
在X++中使用IoC/DI模式应对不断变化的客户需求
package exp2;
public class SquareTraversalApplication {
public static void main(String[] args) {
int size = 5;
SquareTraversal traversal = new AntiDiagonal(size);
traversal.traverse(); // 遍历方阵并输出结果
}
}
阅读全文