首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

谁给小弟我看看 小弟我写的程序错在哪了

2012-01-23 
哪位高手给我看看 我写的程序错在哪了?下面这段程序能编译通过但链接时出错了怎么回事?#includestdio.h#

哪位高手给我看看 我写的程序错在哪了?
下面这段程序   能编译通过   但链接时出错了   怎么回事?
#include   <stdio.h>
#include   <stdlib.h>

void   ShellSort(int   *array,int   high);
void   ShellInsert(int   *array,int   high,int   gap);

int   main   (void)
{
  int   num=10;
  int   temp[10]={10,2,23,14,8,19,18,15,18,1};
  int   low1=0;
  int   high1=num-1;
puts( "the   date   before   sort: ");
for(   int   i=0;i <num;i++)
{
  printf( "%4d ",temp[i]);
}
printf( "\n ");
 
ShellSort(temp,high1);
puts( "the   date   after   sort: ");
for(   i=0;i <num;i++)
{
  printf( "%4d ",temp[i]);
}
printf( "\n ");
return   0;
}

void   ShellSort(int   *   array,int   high)
{

int   gap=(high+1)/2;
while(gap)
{

      ShellInsert(array,high,gap);

      gap=gap==2?1:(int)(gap/2);
}
}

void   shellInsert(int   *array,int   high,int   gap)
{
     
  int   tempdata,i,j;
  for(i=gap;i <=high;i++)
  {
    tempdata=array[i];
    j=i;
    while(j> gap&&tempdata <array[j-gap])
    {
      array[j]=array[j-gap];
      j-=2;
    }
    array[j]=tempdata;
  }
}


[解决办法]
声明时void ShellInsert(int *array,int high,int gap);
定义时void shellInsert(int *array,int high,int gap)

s大小写不一样, 给我分.

热点排行