| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 551 人关注过本帖
标题:希望前辈帮帮,为啥这个程序代码不能运行,错在哪里。。。
取消只看楼主 加入收藏
付得福
Rank: 1
等 级:新手上路
帖 子:24
专家分:4
注 册:2013-10-30
结帖率:66.67%
收藏
已结贴  问题点数:20 回复次数:0 
希望前辈帮帮,为啥这个程序代码不能运行,错在哪里。。。
#define maxlen  100
typedef struct
{int data[maxlen];
 int listlen;
}seqlist;

#include<stdio.h>
void main()
{
seqlist L;

void initial_list(seqlist L);

int i,x;
int data[]={1,2,3,4,5,6,7,8,9,10};

void list_insert(seqlist L,int x);
printf("please enter a num:");
scanf("%d",&x);
list_insert(L,x);
printf("输出插入后的顺序:");
for(i=0;i<L.listlen;i++)
  printf("%5d",L.data[i]);
}

void initial_list(seqlist L)
{
    L.listlen=0;
}


void list_insert(seqlist L,int x)
{int j=L.listlen-1;
 if(j>maxlen) error("overflow");
 else{
     while(j>=0 && L.data[j]>x)
     {L.data[j+1]=L.data[j];
      j--;
     }
     L.data[j+1]=x;
     L.listlen++;
 }
}
搜索更多相关主题的帖子: include please 
2014-01-19 12:15
快速回复:希望前辈帮帮,为啥这个程序代码不能运行,错在哪里。。。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014438 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved