#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define DATA_SIZE 1024
typedef struct
{
double x;
double y;
} Point;
typedef struct Polygon
{
char name[20];
Point point1;
union
{
Point point2;
double Radius;
} cate;
struct Polygon *next;
} Polygon;
int main()
{
FILE *fp=fopen("data.txt","r");
Polygon *L=(Polygon *)malloc(sizeof(Polygon));
L->next=NULL;
Polygon *p=L;
char s[50],ch;
double x1,y1,x2,y2;
fscanf(fp,"%s",s);
printf("输入:%s\n",s);
char Line[100]="LINE";
while(strcmp(s,"END"))
{
Polygon *q=(Polygon *)malloc(sizeof(Polygon));
q->next=NULL;
strcpy(q->name,s);
多边形读取
最新推荐文章于 2021-06-21 10:13:21 发布