用C语言编写程序,输入一元二次方程的系数a,b,c,计算方程的根(假设是两...答:double a,b,c,disc;printf("请输入a,b,c的值:");scanf("%lf %lf %lf",&a,&b,&c);if(a==0) //一元二次方程二次项系数不为0 { printf("data error\n");} else { disc=b*b-4*a*c;if(disc>0)root2(a,b,disc);else if(disc==0)root1(a,b);else root0();} ...
C语言 给定2个矩阵A和B,请计算A * B.(题目测试数据会确保A*B有意义...答:include<stdio.h> include<stdlib.h> main(){ int A1,A2,B1,B2;int **a,**b,**c;int i,j,x,y,z;scanf("%d %d %d %d",&A1,&A2,&B1,&B2);a = (int **) malloc(sizeof(int *) * A1);for (j=0;j<A1;j++){ a[j] = (int *) malloc(sizeof(int) * A2);} ...