diff --git a/DEV1.1/TP07/arctique.c b/DEV1.1/TP07/arctique.c new file mode 100644 index 0000000..49d8f47 --- /dev/null +++ b/DEV1.1/TP07/arctique.c @@ -0,0 +1,14 @@ +#include +#include +#include + +int main(void){ + double r; + double angle; + printf("Rentrez les coordonée du point(espace entre les valeurs:\n"); + scanf("%lf %lf",&r,&angle); + printf("x=%lf\n",r*cos(angle)); + printf("y=%lf\n",r*sin(angle)); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1/TP07/distance.c b/DEV1.1/TP07/distance.c new file mode 100644 index 0000000..9854e6c --- /dev/null +++ b/DEV1.1/TP07/distance.c @@ -0,0 +1,21 @@ +#include +#include +#include + +int main(void){ + double x1; + double x2; + double y1; + double y2; + printf("Rentrez les coordonée du premier point(espace entre les abscisse et ordonnée):\n"); + scanf("%lf %lf",&x1,&y1); + printf("\n"); + getchar(); + printf("Rentrez les coordonée du second point(espace entre les abscisse et ordonnée):\n"); + scanf("%lf %lf",&x2,&y2); + printf("\n"); + printf("distance : %lf\n", sqrt(pow(x2-x1,2)+pow(y2-y1,2))); + + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1/TP07/formules.c b/DEV1.1/TP07/formules.c new file mode 100644 index 0000000..5e10098 --- /dev/null +++ b/DEV1.1/TP07/formules.c @@ -0,0 +1,14 @@ +#include +#include +#include + +int main(void){ + printf("%lf\n",sqrt(fabs(log(0.5)))); + printf("%lf\n",sin(M_PI/6)); + printf("%lf\n",atan(pow(13,2))); + printf("%lf\n",pow(exp(-1),4) ); + printf("%lf\n",log(-3) ); + printf("%lf\n",pow(sqrt(2),2)); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1/TP07/horizontal.c b/DEV1.1/TP07/horizontal.c new file mode 100644 index 0000000..55e91e7 --- /dev/null +++ b/DEV1.1/TP07/horizontal.c @@ -0,0 +1,71 @@ +#include +#include + +int main(void){ + + int tab1[2][5]; + int i; + int j; + for(i=0;i<2;i++){ + for(j=1;j<=5;j++){ + tab1[i][j-1]=j; + } + } + + int tab2[3][5]; + int nb=1; + for(i=0;i<3;i++){ + for(j=0;j<5;j++){ + tab2[i][j]=nb; + nb++; + } + } + + int tab3[5][5]={0}; + nb=0; + for(i=0;i<5;i++){ + for(j=1;j<=nb;j++){ + tab3[i][j-1]=j; + } + nb++; + } + + printf("%10s %17s %17s\n", "t1","t2","t3"); + for(i=0;i<5;i++){ + if(i<2){ + for(j=0;j<5;j++){ + printf("%3d",tab1[i][j]); + } + printf(" "); + for(j=0;j<5;j++){ + printf("%3d",tab2[i][j]); + } + printf(" "); + for(j=0;j<5;j++){ + printf("%3d",tab3[i][j]); + } + printf("\n"); + } + if(i==2){ + printf(" "); + for(j=0;j<5;j++){ + printf("%3d",tab2[i][j]); + } + printf(" "); + for(j=0;j<5;j++){ + printf("%3d",tab3[i][j]); + } + printf("\n"); + } + if(i>2){ + printf(" "); + for(j=0;j<5;j++){ + printf("%3d",tab3[i][j]); + } + printf("\n"); + } + + } + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1/TP07/progression.c b/DEV1.1/TP07/progression.c new file mode 100644 index 0000000..157cf13 --- /dev/null +++ b/DEV1.1/TP07/progression.c @@ -0,0 +1,56 @@ +#include +#include + +int main(void){ + /* + int tab[2][5]; + int i; + int j; + for(i=0;i<2;i++){ + for(j=1;j<=5;j++){ + tab[i][j-1]=j; + } + } + for(i=0;i<2;i++){ + for(j=0;j<5;j++){ + printf("%d ",tab[i][j]); + } + printf("\n"); + } + + int tab[3][5]; + int i; + int j; + int nb=1; + for(i=0;i<3;i++){ + for(j=0;j<5;j++){ + tab[i][j]=nb; + nb++; + } + } + for(i=0;i<3;i++){ + for(j=0;j<5;j++){ + printf("%d ",tab[i][j]); + } + printf("\n"); + } + */ + int tab[5][5]={0}; + int i; + int j; + int nb=0; + for(i=0;i<5;i++){ + for(j=1;j<=nb;j++){ + tab[i][j-1]=j; + } + nb++; + } + for(i=0;i<5;i++){ + for(j=0;j<5;j++){ + printf("%d ",tab[i][j]); + } + printf("\n"); + } + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1/TP07/triangle.c b/DEV1.1/TP07/triangle.c new file mode 100644 index 0000000..84c0fcc --- /dev/null +++ b/DEV1.1/TP07/triangle.c @@ -0,0 +1,37 @@ +#include +#include + +int main(void){ + int tab1[30][30]={0}; + int i; + int j; + int nb=1; + for(i=0;i<30;i++){ + for(j=0;j0&&i>0){ + tab1[i][j]=tab1[i-1][j]+tab1[i-1][j-1]; + } + else{ + if(i==0){ + tab1[i][j]=1; + } + else{ + if(j>=0){ + tab1[i][j]=1; + } + } + } + } + nb++; + } + nb = 1; + for(i=0;i<30;i++){ + for(j=0;j