软件技术基础实验1

时间:2026-01-16

软件技术基础实验1

/* Note:Your choice is C IDE */
#include "stdio.h"
//main()
//{

//}
// 头文件 sqlist.h的内容如下:
#include<stdio.h>

//#include"sqlist.h"
#define OVERFLOW 0

//#define NULL 0

#define OK 1

#define MAXSIZE 1024

typedef int elemtype;

typedef struct

{ elemtype vec[MAXSIZE];

int len;

}sequenlist;

int createsqlist(sequenlist *L,int k)

{ int i;

for( i=0;i<k;i++)

scanf("%d", &L->vec[i]);

return OK;

}

// 以下是整个源程序:



void main()

{ int i,n,k1,k2;

sequenlist *L,a;

printf("\n Input the length of the list L:\n");

scanf("%d",&n);

L=&a;

L->len=n;

createsqlist(L,n);

printf("Output the list and its length:\n");

fo
r(i=0;i<L->len;i++)

printf("%d ", L->vec[i]);

printf("\nThis sequenlist's length is %d", L->len);

}

软件技术基础实验1.doc 将本文的Word文档下载到电脑

    精彩图片

    热门精选

    大家正在看

    × 游客快捷下载通道(下载后可以自由复制和排版)

    限时特价:4.9 元/份 原价:20元

    支付方式:

    开通VIP包月会员 特价:19元/月

    注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
    微信:fanwen365 QQ:370150219