为什么我的阶梯排序是反的?哪里错了?
2 回答
已采纳
蔚蓝海
TA贡献6条经验 获得超3个赞
for (int i = 1; i <= 9; i++) {
for (int j = 1; j <= i; j++) {
System.out.print(i + "*" + j + "=" + (i * j) + "\t");
}
System.out.println();
}
qq_莫非
TA贡献257条经验 获得超93个赞
public static void main(String[] args) {
// TODO Auto-generated method stub
int x,y;
for(x = 0;x <= 9; x++)
{
for(y = 1;y <= x; y++)
{
System.out.print(y+"*"+x+"="+x*y+"\t");
}
System.out.println();
}
}添加回答
举报
0/150
提交
取消
