计算一个c语言3×3矩阵的主对角线的元素之和sum.
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/19 16:03:06
![计算一个c语言3×3矩阵的主对角线的元素之和sum.](/uploads/image/f/7217054-62-4.jpg?t=%E8%AE%A1%E7%AE%97%E4%B8%80%E4%B8%AAc%E8%AF%AD%E8%A8%803%C3%973%E7%9F%A9%E9%98%B5%E7%9A%84%E4%B8%BB%E5%AF%B9%E8%A7%92%E7%BA%BF%E7%9A%84%E5%85%83%E7%B4%A0%E4%B9%8B%E5%92%8Csum.)
#include<stdio.h>#define ROW 3//行数#define COL 4//列数void PlusMatrix(in
#includemain(){\x09inta[3][3],i,j,sum=0;\x09printf("请输入数组元素:(3*3)\n");\x09for(i=0;i
#includevoidmain(){inta[3][3];inti,sum1,sum2;for(i=0;i
#include"stdio.h"intmain(){inta[10][10]={0};intn,i,j,sum1=0,sum2=0;scanf("%d",&n);for(i=0;i
#include#includeintmain(){intm,n,i,j,s;intarr[30][30];while(scanf("%d%d",&m,&n)!=EOF){for(i=0
intget_max(inta[4][4]){inti,j;intmax=-0xfffffff;for(i=1;i
//正确的程序如下:#includevoidmain(){inti,j,n,*tem[3];intp[2][3],q[3][2],r[2][2];tem[0]=p[0];tem[1]=q[0];tem
#include<stdio.h>int main(){ int a[2][3]; &n
#includevoidmain(){\x09inta[3][2]={1,2,3,4,5,6};\x09intb[2][3],i,j;\x09for(i=0;i
if(j==4)\x09\x09\x09\x09printf("%d\n",max);去掉if(j==4)加大括号.改成这样:#defineM3#defineN5#includevoidmain(){
#includevoidasum(doublea[3][3],doubleb[3][3],doublec[3][3]){inti,j;for(i=0;i
#include"stdio.h"intmain(){ inta[10][10]; intm,n,tmp,i
#includeintmain(){intarray[3][3],sum;inti,j;for(i=0;i{for(j=0;j{scanf("%d",&array[i][j]);}}sum=array
#includemain(){inti,j,a[3][4],max;for(i=0;i
#include#include#defineX3#defineY3inta[X][Y];intb[X][Y];intc[X][Y];voidmatrix(intb[][X],intc[][Y]);v
#includeintmain(){floatst[3][3],sum=0;inti,j;for(i=0;ist[i][j];for(i=0;i
#includevoidmain(){inta[3][4],b[3][4],c[3][4],i,j;printf("pleaseinputaarray:\n");for(i=0;i
#include"stdio.h"voidmain(){voidzhuan(intarray[2][3],intb[3][2]);intarray[2][3],b[3][2];inti,j;print
#includeintmain(){inta[3][3];inti;intj;for(i=0;i
#include"stdio.h"intmain(){freopen("cz.dat","r",stdin);freopen("jg.dat","r",stdout);inta[3][3],b[3][