We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#include <stdio.h> #include <stdlib.h> struct ju{ int a; struct ju*next; }*h1,h2,*h3,*p,*q,*s,*o,*l; //创建链表 void creat() { int a,n; int i=1; scanf("%d",&n);//判断矩阵的阶数 scanf("%d",&a);//矩阵内输入值 h1=NULL; //头指针为空 //前面的矩阵 以行的形式输入 for(int j=1;j<=1000;j++) { while(i<=1000) { s=(struct *)malloc(sizeof(stu ju)); s->a=a; //完成连接操作 if(h1==NULL) { h1=s; p=s; } else { p->next=s; p=p->next; } i++; scanf("%d",&a); } } //第二个矩阵 以列的形式输入 int b; for(int j=1;j<=1000;j++) { while(i<=1000) { s=(struct *)malloc(sizeof(struct ju)); s->a=b; //完成连接操作 if(h2==NULL) { h2=s; q=s; } else { q->next=s; q=q->next; } i++; scanf("%d",&b); } } //乘积得值 void cheng() { p=h1; q=h2; h3=NULL; int x=1; for(int m=1;p==NULL;m++) { p=p->next; if(m%1000==0) { for(int n=1;q==NULL;n++) { q=q->next; if(n%1000==0) { while(x!=1000) { o=(struct *)malloc(sizeof(struct ju)); o->a=(p->a)*(q->a); if(h3==NULL) { h3=o; l=o; } else { l->next=o; o=o->next; } x++; } } } } } void print() { l=h3; while(l==NULL) { printf("%d",l->a); l=l->next; } } int main() { creat(); cheng(); print(); system("pause"); return 0; }
The text was updated successfully, but these errors were encountered:
点评:
修改!
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: