代码实现:
clear, clc for i = 1:9 for j = 1:i fprintf('%d*%d=%d ', i, j, i * j) if i == j fprintf('\n') continue end end end
运行效果: