建立一个顺序表,将a,b,c,d放入表中,然后在main函数中输出!

来源:百度知道 编辑:UC知道 时间:2024/05/26 16:17:13

// List.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"

#define OK 1
#define ERROR 0
#define OVERFLOW 0
#define INIT_LIST_SIZE 30
#define LIST_INC_SIZE 10
#define ElemType char
typedef struct List
{
ElemType* elem;
int listSize;
int length;
}List, *pList;

int InitList( List &L )
{
L.listSize = INIT_LIST_SIZE;
L.length = 0;

if( !( L.elem = ( ElemType* )malloc( sizeof( ElemType ) * L.listSize ) ) )
exit( OVERFLOW );

return OK;
}

int ListInsert( List &L, int pos, ElemType e )
{
int i;
ElemType *p;

if( pos < 0 || pos > L.length )
return ERROR;

if( L.length >= L.listSize )
{
if( !( p = ( ElemType* )realloc( L.elem, sizeof( ElemType ) * ( L.listSize + LIST_INC_SIZE ) ) ) )
exit( OVERFLOW );
L.elem = p;
L.listSize += LIST_INC_S

如何用C语言编写一个计算机程序,实现任意输入三个数a,b,c,将他们按照从大到小的顺序输出 急!!!!!构造一个顺序栈,将表达式y=a+b*c-d/e中各个元素依次压入栈中,然后依次弹出。 编写函数f(&a,&b,&c) 将3个整数按由大到小到顺序调整后依次放入a,b,c,a放最大,要求形参崴指针类型 如果一个堆栈的入栈序列是A B C D E 则堆栈的不可能输出顺序是 A.EDCBA B.DECBA C.DCEAB D.ABCDE 用c语言编写一个程序:两个字符串a、b,将a中所有b中含有的字符删除。 A B C D可以排哪写顺序? (要全) 写一个程序,由大至小依次输出顺序读入的三个整数a,b,c的值。 已知:A、B、C各为一个数字,A+A=B+B+B,B+B+B=C+C+C+C,A+B+C+C=400,求A、B、C各等于多少? excel里假如 a=b,a=c,如何将b=c对应起来 假如数据库的一个表有四个栏位分别是A,B,C,D,要将AC数据对调,BD数据对调,