#include<stdio.h> struct student{ int id; int socre; }stu; int main() { int n,m,i,j; scanf("%d %d",&n,&m); struct stu a[n],b[m],c[n+m],t; for(i=0;i<n;i++) { scanf("%d %d",&a[i].id,&a[i].socre); c[i]=a[i]; } for(i=0;i<m;i++) { scanf("%d %d",&b[i].id,&b[i].socre); c[i+n]=b[i]; } for(i=0;i<m+n-1;i++) { int temp=i; for(j=i+1;j<m+n;j++) { if(c[j].id<c[temp].id) temp=j; } t=c[temp]; c[temp]=c[i]; c[i]=t; } for(i=0;i<m+n;i++) printf("%d %d\n",c[i].id,c[i].socre); } /* Main.c: In function 'main': Main.c:10:13: error: array type has incomplete element type struct stu a[n],b[m],c[n+m],t; ^ Main.c:10:18: error: array type has incomplete element type struct stu a[n],b[m],c[n+m],t; ^ Main.c:10:23: error: array type has incomplete element type struct stu a[n],b[m],c[n+m],t; ^ Main.c:10:30: error: storage size of 't' isn't known struct stu a[n],b[m],c[n+m],t; ^ Main.c:23:10: warning: variable 'temp' set but not used [-Wunused-but-set-variable] int temp=i; ^ Main.c:10:30: warning: unused variable 't' [-Wunused-variable] struct stu a[n],b[m],c[n+m],t; ^ Main.c:10:23: warning: unused variable 'c' [-Wunused-variable] struct stu a[n],b[m],c[n+m],t; ^ Main.c:10:18: warning: unused variable 'b' [-Wunused-variable] struct stu a[n],b[m],c[n+m],t; ^ Main.c:10:13: warning: unused variable 'a' [-Wunused-variable] struct stu a[n],b[m],c[n+m],t; ^ */ |
Double click to view unformatted code.