#include

#include

#include

#define MAXLEN 100

typedef int ElemType;

typedef struct

{

int i,j;// 行下标,列下标

ElemType e;         //元素值

} Doubtle;

typedef struct

{   Doubtle data[MAXLEN+1]; // 非零元三元组表,data[0]未用

int m,n,t;// 矩阵的行数、列数和元素个数

} Matrix;

int InitMatrix(Matrix *M)

{

*M=(Matrix*)malloc(sizeof(Matrix));

}

int MatrixCreat(Matrix M)

{   int a,b;

srand((int)time(NULL));

a=rand()%10+1;

b=rand()%10+1;

M.m=a;

M.n=b;

M.t=a*b;

int i,j,e;

for(e=1;e<=M.t;e++)

{for(i=1;i<=M.m;i++)

{for(j=1;j<=M.n;j++)

{srand((int)time(NULL));

M.data[e].e=rand()%50+1;

M.data[e].i=i;

M.data[e].j=j;

e++;

}

}

}

}

// 输出矩阵M

void PrintSMatrix(Matrix M)

{

int i;

printf("\n %d 行, %d 列, %d 个元素。\n",M.m, M.n, M.t);

printf("%4s %4s %8s\n", "i", "j", "e");

printf("======================\n");

for(i=1; i<=M.t; i++)

printf("%4d %4d %8d\n", M.data[i].i, M.data[i].j, M.data[i].e);

}

void qiuanma(Matrix M)

{

int q,p;

int MAX=0,MIN=100;

int lie,hang;

int anma;

for(q=1;q<=M.m;q++)

{

for(p=1;p<=M.n;p++)

{

if(M.data[p].e>MAX)

{MAX=M.data[p].e;

lie=M.data[p].j;}

}

if(M.data[q].e

{MIN=M.data[q].e;

hang=M.data[q].i;

}

}

if(MIN==MAX)

{anma=MIN;}

printf("\n鞍马点为第%d行第%d列,元素值为%d",hang,lie,anma);

}

int main(int argc, char *argv[])

{   Matrix *T;

InitMatrix(T);

MatrixCreat(*T);

PrintSMatrix(*T);

qiuanma(*T);

return 0;

}

我想创建一个随机矩阵,然后求它的鞍马点的行列以及值,但是给矩阵分配空间的时候好像出了问题

c语言int doubt,c语言错误error: incompatible types in assignment相关推荐

  1. C: error: incompatible types when initializing type ‘int’ using type ‘atomic_t’ {aka ‘struct <anonym

    typedef.c:17:10: error: incompatible types when initializing type 'int' using type 'atomic_t' {aka ' ...

  2. error: incompatible types when assigning to type ‘const struct wiphy_wowlan_support‘

    环境说明 系统:Centos7 (3.10.0) 驱动版本:00014996-RTL8192EU_linux_v5.6.3.1_34030_COEX20171113-0047.20190613.zip ...

  3. 使用Process运行程序提示error: incompatible types: java.lang.Process cannot be converted to android.os.Proces

    一.在android framework sevice里面 添加下面的代码,使用Process  java中运行第三方程序,编译的时候提示 error: incompatible types: jav ...

  4. linux 内核编译错误 error: conflicting types for ‘syscall_trace_enter’

    编译内核出现如下错误: arch/x86/kernel/ptrace.c:1472:17: error: conflicting types for 'syscall_trace_enter'  In ...

  5. c 语言 int argc,C语言深度学习之int main(int argc,char **argv)的理解及延申

    C语言深度学习之int main(int argc,char **argv)的理解及延申 前者为可接受 命令行参数,argc表示参数个数, argv[]是参数数组,其中第0个参数是程序本身的名称(包含 ...

  6. c语言int val,c语言不定参数与printf函数的实现

    今天学习了C语言不定参数,C语言中的不定参数主要靠这个头文件实现,这个头文件包含了va_list().va_start().va_end()三个宏,其用法为先声明一个va_list类型的变量,它用于访 ...

  7. c语言 int转char_c语言的函数指针

    简单定义并间接调用 #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<time.h> void singas ...

  8. c语言 int max,C语言 0x7fffffff是多少(也就是INT_MAX,首位是 0,其余都是1,f代表1111)...

    可以算一下 0x7FFFFFFF 是多少 每个十六进制数4bit,因此8位16进制是4个字节,刚好是一个int整型 F的二进制码为 1111 7的二进制码为 0111 这样一来,整个整数 0x7FFF ...

  9. call stack是什么错误_Go语言(golang)的错误(error)处理的推荐方案

    原文链接:https://www.flysnow.org/2019/01/01/golang-error-handle-suggestion.html 微信公众号:flysnow_org(飞雪无情) ...

  10. 编程英语:常见代码错误 error 语句学习(8)

    编程英语:常见代码错误 error 语句学习(8) error 1:Error in expression 表达式错误 error 2:Illegal assignment 非法赋值 error 3: ...

最新文章

  1. 洛谷P1016 旅行家的预算 贪心
  2. linux下aio异步读写详解与实例
  3. Snipaste在Window运行后遇到提示计算机中丢失 api-ms-win-crt-runtime-l1-1-0.dll 错误
  4. vant 项目_vueCli4+vant+router+vuex+移动端适配
  5. 结合PE格式对linker分析1
  6. mysql 实现非递归树_二叉树的非递归前序,中序,后序遍历算法
  7. [POJ2406]字符串的幂
  8. k均值聚类+基于核的k均值聚类+C++实现
  9. QProgressDialog setValue过快导致死机问题记录
  10. 如何获取微信用户openid
  11. 数据库32位升级到64位解决方案
  12. android 7种网络连接方式--IT蓝豹
  13. Springboot 搭建oss文件上传服务器
  14. AutoDL 算力云 服务器租用教程
  15. C语言每日一练——第90天:青蛙跳台阶(升级版)
  16. 超详细从零开始安装yolov5
  17. 国家专利有什么价值?
  18. 软考中级软件设计师--9.计算机网络
  19. 笔记:JavaScript逆向爬虫
  20. web容器的加载过程

热门文章

  1. 【汇编】更灵活的定位内存地址方式——and,or命令、SI、DI变址寄存器、直接寻址[idata]、寄存器间接寻址[bx]、寄存器相对寻址[bx+idata]、基址变址寻址、相对基址变址寻址
  2. 安装dataX的问题,com.alibaba.datax.common.exception.DataXException: Code:[Common-00], Describe
  3. 接收灵敏度dbm与W
  4. php短信不同账号发,php用不同平台批量发短信
  5. unity识别图片颜色并把颜色数量排序
  6. 数组重新定义key值,去重,排序
  7. 51单片机 程序 红外发射 红外接收 红外双机通信 红外遥控器 控制 灯 系统 proteus 仿真
  8. 《MonoIndoor:Towards Good Practice of Self-Supervised Monocular Depth Estimation...》论文笔记
  9. 如何把图片制作做成GIF表情包?分享在线快速制作GIF图片的方法
  10. python基础ppt_python基础知识(三)