![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/bafef680f1c0c079287d7e771341a92b.png)
#include <stdio.h>
int main() {
int x = 10;
int y[x][x];
for (int i = 0; i < x; i++) {
y[i][0] = 1;
y[i][i] = 1;
for (int j = 2; j < x; j++) {
y[i][j] = y[i-1][j-1] + y[i-1][j];
}
}
for (int i = 0; i < x; i++) {
for (int j = 0; j <= i; j++) {
printf("%d ", y[i][j]);
}
printf("\n");
}
return 0;
}
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/31c0d9bbe670afbe08d9675c72fbb6ea.png)
#include <stdio.h>
int main() {
int arr[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
int maxhang = arr[0][0];
int maxlie = 0;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
if (arr[i][j] > maxhang) {
maxhang = arr[i][j];
maxlie = i;
}
}
}
printf("最大值:%d\n", maxhang);
printf("最大值所在的列号:%d\n", maxlie);
return 0;
}