-3

我正在尝试锻炼如下图所示的表格。我曾尝试使用 for 循环,但似乎无法获得正确的结果。有人可以在这里帮我..谢谢负载!

这是我的代码:

double XCor = 10;
double YCor = 10;

double incrt = 0.1;

int j = 0;
while (j <= 10) {
    for (double i = 0.0; i <= XCor; incrt++) {
        System.out.println("Count is: " + i);
    }
    double x = j / YCor;
    System.out.println("Count is: " + x);
    j++;
}

在此处输入图像描述

4

1 回答 1

0
for (double x = 0.0; x <= XCor; x += incrt) {
  for (double y = 0.0; y <= YCor; y += incrt) {
    System.out.printf("x=%f, y=%f\n", x, y);
  }
}
于 2013-05-13T10:39:22.127 回答