c语言新人求助啊
#include <stdio.h>int main() {
int m,n;
scanf("%d %d",&m,&n);
int i=0;
int q[m];
struct qwe{
char b[32];
int q;
int w;
int e;
int r;
int t;
};
for(i=0;i<m;i++) {
struct qwe a[i];
scanf("%s %d %d %d %d",&a[i].b,&a[i].q,&a[i].w,&a[i].e,&a[i].r,&a[i].t);
q[i]=a[i].q*3+a[i].w*1;
}
int j;
struct qwe tem;
for(i=0;i<m-1;i++) {
for(j=0;j<m-1-i;j++) {
if(q[j]<q[j+1]) {
tem=a[j];
a[j]=a[j+1];
a[j+1]=tem;
}
}
}
for(i=0;i<n;i++) {
printf("%s %d %d %d %d",a[i].b,a[i].q,a[i].w,a[i].e,a[i].r,a[i].t);
}
return 0;
}
提示错误:27 15 C:\Users\asus\Desktop\02x.cpp [Error] 'a' was not declared in this scope
[此贴子已经被作者于2016-12-13 15:53编辑过]