自己好了,,程序

来源:互联网 发布:淘宝手机端免费模板 编辑:程序博客网 时间:2024/05/16 10:01

怪事了,啊,

竟然迷了我小半天,狂晕了,但是,最后有自己好了

Jasper20100513

#include "stdio.h"

#define B 5

static int  top=0;

int s[B];

void inter(int s[])

{  int n ; 

printf("/n开始输出栈中的值;/n");

while(top<B)

  {scanf("%d",&n);

  s[top++]=n;

  }

}

void add(int s[])

 { int i,p,j,r[B];

 p=top;

  while(p>0)

 printf("%3d",s[--p]);

 

 Efor(i=0;i<B; i++)

 r[i]=s[--top];

 for(j=0;j<B;j++)

  printf("%d",r[j]);

 

 }

main()

{   

inter(s);

   add(s);

}

结果是

                

         发的

    

    

原创粉丝点击