69,369
社区成员
发帖
与我相关
我的任务
分享
for (iteration = 0; iteration < 999; iteration++) {
for (i = 1; i < 99; i++){
for (j = 1; j < 99; j++){
h[next][i][j] = 0.25 * (h[current][i-1][j] + h[current][i+1][j] + h[current][i][j-1] + h[current][i][j+1]);
}
}
current = next; // swap values of current and next
next = 1 - current;
}