69,371
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#define MAX 100
typedef struct {
int data[MAX];
int len; /* the length of the seqlist */
}SeqList;
main()
{
SeqList *p;
int i = 0;
char ch = 0;
printf("Please input an array:\n");
while (i < MAX && ch != EOF)
scanf("%d%c", &p->data[i++], &ch);
p->len = i;
for (i = 0; i < p->len; i++)
printf("%5d", p->data[i]);
}