发布网友 发布时间:2022-05-11 07:08
共1个回答
热心网友 时间:2023-10-07 15:22
摘要"#include \#define N 3\#define M 3\\void trans(int a[N][M])\{\int temp;\for (int i = 0; i < N; i++)\{\for (int j = i; j < M; j++)\{\temp = a[i][j];\a[i][j] = a[j][i];\a[j][i] = temp;\}\}\}\void show(int a[N][M])\{\for (int i = 0; i < N; i++)\{\for(int j = 0; j < M; j++)\{\printf(\"%d\\t\",a[i][j]);\}\printf(\"\\n\");\}\}\int main()\{\int a[N][M];\for(int i = 0; i < N; i++)\{\for(int j = 0; j < M; j++)\scanf(\"%d\",&a[i][j]);\}\trans(a);\printf(\"转置后为:\\n\");\show(a);\return 0;\}"咨询记录 · 回答于2021-05-16Python 统计并输出文本文件中每行单词个数和总单词个数,即类似如下输出:您好,您有什么问题呢就是图上的问题,第三题怎么输出这个稍等3.5+4.7=8.2这个第三题的代码怎么编?稍等"#include \#define N 3\#define M 3\\void trans(int a[N][M])\{\int temp;\for (int i = 0; i < N; i++)\{\for (int j = i; j < M; j++)\{\temp = a[i][j];\a[i][j] = a[j][i];\a[j][i] = temp;\}\}\}\void show(int a[N][M])\{\for (int i = 0; i < N; i++)\{\for(int j = 0; j < M; j++)\{\printf(\"%d\\t\",a[i][j]);\}\printf(\"\\n\");\}\}\int main()\{\int a[N][M];\for(int i = 0; i < N; i++)\{\for(int j = 0; j < M; j++)\scanf(\"%d\",&a[i][j]);\}\trans(a);\printf(\"转置后为:\\n\");\show(a);\return 0;\}"