C语言训练-求矩阵的两对角线上的元素之和 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main() { int arr[100][100]; int n,i,j; int sum…… 题解列表 2023年01月01日 0 点赞 0 评论 106 浏览 评分:0.0
求矩阵的两对角线上的元素之和 摘要:解题思路:创建一个二维数组。注意事项:首先要注意矩阵为偶数和奇数输出的答案是不一样的,因此要分情况讨论。矩阵为偶数时,直接输出,两条对角线相加,矩阵为奇数时,两条对角线相交的那个位置的值会重复加多一次…… 题解列表 2023年01月03日 0 点赞 0 评论 204 浏览 评分:0.0
不要想太多,这样简单 摘要:解题思路:基本C语言注意事项:无参考代码:#include<stdio.h>int main(){ int N; scanf("%d",&N); int a[N][N],i,j,J…… 题解列表 2023年03月02日 0 点赞 0 评论 130 浏览 评分:0.0
1138: C语言训练-求矩阵的两对角线上的元素之和 摘要:#include<stdio.h> int main() { int p,q; scanf("%d",&q); p=q; int a[p][p]; …… 题解列表 2023年03月13日 0 点赞 0 评论 75 浏览 评分:0.0
求矩阵的两对角线上的元素之和python 摘要:解题思路:注意事项:参考代码:n = int(input())L = []s = 0for i in range(n): L.append(list(map(int,input().split(…… 题解列表 2023年03月25日 0 点赞 0 评论 147 浏览 评分:0.0
nxn矩阵的两对角线上的元素之和 摘要:解题思路:对于nxn级矩阵求对角线的和,实际是选取主对角线及下标和为n-1的数组和同时减去中心数组的值注意事项:参考代码:#include<iostream> using namespace std…… 题解列表 2023年04月03日 0 点赞 0 评论 84 浏览 评分:0.0
C语言训练-求矩阵的两对角线上的元素之和 摘要:解题思路:#include<bits/stdc++.h>using namespace std;int main(){ int i,j,s=0; int n; int a[10][10]; cin>>…… 题解列表 2023年06月06日 0 点赞 0 评论 102 浏览 评分:0.0
矩阵两对角线上的元素之和(简单代码) 摘要:解题思路:当n是奇数时,可以发现多算了一次a[n/2][n/2]注意事项:参考代码:#include<stdio.h>int main(){ int n;//N*N的矩阵 scanf("%…… 题解列表 2023年09月23日 0 点赞 0 评论 159 浏览 评分:0.0
求矩阵的两对角线上的元素之和 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int n; cin>>n; int arr[n][n]…… 题解列表 2023年10月18日 0 点赞 0 评论 125 浏览 评分:0.0
C语言训练-求矩阵的两对角线上的元素之和数组求解(新手小白) 摘要:解题思路:注意事项:注意N为奇偶数所产生的重复性情况参考代码:#include<stdio.h>int main(){ int sum1=0,sum2=0; int N; int a[10][10];…… 题解列表 2023年10月22日 0 点赞 0 评论 119 浏览 评分:0.0