qq_33601547
2016-01-02 15:33
采纳率: 50%
浏览 1.3k

C语言结构数组的题,请大神看看错误出在哪里

#include
struct sell
{
char dm[4];
char mc[10];
int dj;
int sl;
long int je;
}sell[100];
void main()
{
int i,j,t;
long int m;
for(i=0;i scanf("%s,%s,%4d,%5d,%5d\n",&sell[i]dm,&sell[i].mc,&sell[i].dj,&sell[i].sl,&sell[i].je);
for(i=0;i for(i=0;i if(struct(sell[i].mc>sell[i+1].mc)
{
t=sell[i].mc;
sell[i].mc=sell[i+1].mc;
sell[i+1].mc=t;
}
else if(sell[i].mc==sell[i+1].mc)
{
if(sell[i].je>sell[i+1].je)
{
m=sell[i].je;
sell[i].je=sell[i+1].je;
sell[i+1].je=m;
}
}

for(i=0;i<100;i++)
printf("%s,%s,%4d,%5d,%5d\n",sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);
}

2条回答 默认 最新

相关推荐 更多相似问题