-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpoint_struct.cpp
More file actions
44 lines (41 loc) · 906 Bytes
/
point_struct.cpp
File metadata and controls
44 lines (41 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include<stdio.h>
#include<stdlib.h>
int i;
struct s_point
{
char x;
float y;
float z;
};
main()
{
int NP;
struct s_point hei(struct s_point,int );
void heli55555(struct s_point *x,int i);
struct s_point *Courbe;
printf("donnez combiane des note tu va reserve : ");
scanf("%d",&NP);
Courbe=(struct s_point *)malloc(NP*sizeof(struct s_point));
for(int i=0;i<NP;i++)
{
Courbe[i]=hei(Courbe[i],i);
}
printf("fin take");
for(int i=0;i<NP;i++)
{
heli55555(Courbe,i);
}
}
struct s_point hei(struct s_point Courbe1,int i)
{
printf("\ndonnez le point %d : \n ",i+1);
if (i==0)
printf("example: A(x,y)\n");
scanf("%c(%f;%f)",&Courbe1.x,&Courbe1.y,&Courbe1.z);
getchar();
return(Courbe1);
}
void heli55555(struct s_point *Courbe,int i)
{
printf("\nle point %c a des cordone : \nx=%g\ny=%g",(Courbe+i)->x,(Courbe+i)->y,(Courbe+i)->z);
}