DEbut TP08
This commit is contained in:
BIN
DEV1.1/TP07/progression
Executable file
BIN
DEV1.1/TP07/progression
Executable file
Binary file not shown.
21
DEV1.1/TP07/progression.c
Normal file
21
DEV1.1/TP07/progression.c
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
int u0=0,u1=1,utemp,nieme,terme;
|
||||||
|
printf("Donnez un entier : ");
|
||||||
|
scanf("%d",&nieme);
|
||||||
|
if (nieme==0)
|
||||||
|
printf("%d\n",u0);
|
||||||
|
else if (nieme==1)
|
||||||
|
printf("%d\n",u1);
|
||||||
|
else{
|
||||||
|
for (terme=2;terme<=nieme;terme++){
|
||||||
|
utemp=u0+u1;
|
||||||
|
u0=u1;
|
||||||
|
u1=utemp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("%d\n",u1);
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
BIN
DEV1.1/TP07/table
Executable file
BIN
DEV1.1/TP07/table
Executable file
Binary file not shown.
@@ -3,11 +3,22 @@
|
|||||||
#define TAILLE 10
|
#define TAILLE 10
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
double forme_nombre,taille_carre=TAILLE^2,tour;
|
int ligne,colonne,valeurs;
|
||||||
for (tour=0;taille_carre>10;tour++){
|
printf(" X |");
|
||||||
taille_carre/=10;
|
for (valeurs=0;valeurs<=TAILLE;valeurs++){
|
||||||
forme_nombre++;
|
printf(" %5d",valeurs);
|
||||||
|
}
|
||||||
|
printf("\n------+");
|
||||||
|
for (valeurs=0;valeurs<=TAILLE;valeurs++){
|
||||||
|
printf("------");
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
for (ligne=0; ligne<=TAILLE; ligne++){
|
||||||
|
printf("%5d |",ligne);
|
||||||
|
for (colonne=0; colonne<=TAILLE; colonne++){
|
||||||
|
printf(" %5d",colonne*ligne);
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
}
|
}
|
||||||
for
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
31
DEV1.1/TP08/figures.c
Normal file
31
DEV1.1/TP08/figures.c
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
int hauteur_carre,etage,espace,forme,tour_etage,tour_etoile;
|
||||||
|
printf("t) Triangle \nc)Carré \nq)Quitter\n");
|
||||||
|
scanf("%c",&forme);
|
||||||
|
printf("Donnez un entier pour le nombre d'étage : ");
|
||||||
|
scanf("%d",&etage);
|
||||||
|
if (forme=='q')
|
||||||
|
printf("Au revoir ...\n");
|
||||||
|
else if (forme=='c') {
|
||||||
|
for (tour_etoile=0;tour_etoile<etage;tour_etoile++){
|
||||||
|
printf("* ");
|
||||||
|
for (hauteur_carre=0;hauteur_carre<(etage-2);hauteur_carre++){
|
||||||
|
for (espace=0;espace<(espace/2);espace++){
|
||||||
|
printf(" ");
|
||||||
|
}
|
||||||
|
for (tour_etage=0;tour_etage<etage;tour_etage++){
|
||||||
|
for (tour_espace=0;tour_espace<(espace/2);tour_espace++){
|
||||||
|
printf(" ");
|
||||||
|
}
|
||||||
|
for (tour_etoile=0;tour_etoile<nbr_etoile;tour_etoile++){
|
||||||
|
printf("*");
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
nbr_etoile+=2;
|
||||||
|
espace-=2;
|
||||||
|
}
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
BIN
DEV1.1/TP08/sapin
Executable file
BIN
DEV1.1/TP08/sapin
Executable file
Binary file not shown.
21
DEV1.1/TP08/sapin.c
Normal file
21
DEV1.1/TP08/sapin.c
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
int nbr_etoile=1,etage,espace,tour_etage,tour_espace,tour_etoile;
|
||||||
|
printf("Donnez un entier pour le nombre d'étage : ");
|
||||||
|
scanf("%d",&etage);
|
||||||
|
espace=(etage-1)*2;
|
||||||
|
for (tour_etage=0;tour_etage<etage;tour_etage++){
|
||||||
|
for (tour_espace=0;tour_espace<(espace/2);tour_espace++){
|
||||||
|
printf(" ");
|
||||||
|
}
|
||||||
|
for (tour_etoile=0;tour_etoile<nbr_etoile;tour_etoile++){
|
||||||
|
printf("*");
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
nbr_etoile+=2;
|
||||||
|
espace-=2;
|
||||||
|
}
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user