简答的输出问题求助,想了很久找不到问题所在
#include<stdio.h>#include<stdlib.h>
typedef struct Waterdate
{
long long high;
long long wide;
struct Waterdate * next;
} WATER;
int main()
{
int n,i,a;
scanf("%d",&n);
WATER * head;
head=(WATER *)malloc(sizeof(WATER));
for(i=0;i<n;i++)
{
head->next=(WATER * )malloc(sizeof(WATER));
head=head->next;
a=scanf("%d %d",&(head->high),&(head->wide));
printf("%d %d ",head->high,head->wide,a);
}
head->next=NULL;
system("pause");
return(0);
}
问题
a不是应该是scanf成功输入的数据的个数吗,为什么打印不出来
head->next 为什么打印不出来