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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
| #include <stdio.h>#include <stdlib.h>
#define sigma 0.02
struct point {
float x ;
float y ;
}
typedef struct Point Point;
Point ScanP(int k,Point P)
{
printf("Please Enter X and Y of point %d ",k+1);
scanf("%d %d",&P.y,&P.x);
return P;
}
void AffichePoint(Point P, int i)
{
printf("Point %d :(%d,%d)\t",i+1,P.x,P.y);
}
void NormePoint(Point P)
{
printf("Point :(%d,%d) : %f\t",P.x,P.y,sqrt(pow(P.x,2)+pow(P.y,2)));
}
int main()
{
int k=0 ,i;
Point X;
int U[50][50]; /* matrice unitaire */
int N; /* dimension de la matrice unitaire */
int I, J;
printf("choisir la solution initiale ");
ScanP(0,X);
printf("donnez le nbr de composants ");
scanf("%d",i);
for (I=0; I<i; I++)
for (J=0; J<i; J++)
if (I==J)
U[I][J]=1;
else
U[I][J]=0;
for(j=1;j<=i;j++){
for(g=1;g<=i;g++){
w= (X.x,X.y)+ s *U[j][g]
}
}
} |