update
This commit is contained in:
32
DEV/DEV1.1_suite/concept_en_vrac/Q1.c
Normal file
32
DEV/DEV1.1_suite/concept_en_vrac/Q1.c
Normal file
@@ -0,0 +1,32 @@
|
||||
//2 4 8 16 32 64 128 256 512 1024
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
struct soldat{
|
||||
unsigned short int durabilite: 10;
|
||||
unsigned short int deplacement: 4;
|
||||
unsigned short int defense: 7;
|
||||
unsigned short int degat: 7;
|
||||
unsigned short int distance: 4;
|
||||
|
||||
};
|
||||
|
||||
union soldat{
|
||||
unsigned short int durabilite;
|
||||
unsigned short int deplacement;
|
||||
unsigned short int defense;
|
||||
unsigned short int degat;
|
||||
unsigned short int distance;
|
||||
};
|
||||
|
||||
void createSoldat(soldat* soldat){
|
||||
soldat->durabilite = 7;
|
||||
soldat->deplacement = 7;
|
||||
soldat->defense = 7;
|
||||
soldat->degat = 7;
|
||||
soldat->distance = 7;
|
||||
}
|
||||
|
||||
int main(void){
|
||||
return 0;
|
||||
}
|
31
DEV/DEV1.1_suite/concept_en_vrac/Q1.c~
Normal file
31
DEV/DEV1.1_suite/concept_en_vrac/Q1.c~
Normal file
@@ -0,0 +1,31 @@
|
||||
//2 4 8 16 32 64 128 256 512 1024
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
struct soldat{
|
||||
unsigned short int durabilite: 10;
|
||||
unsigned short int deplacement: 4;
|
||||
unsigned short int defense: 7;
|
||||
unsigned short int degat: 7;
|
||||
unsigned short int distance: 4;
|
||||
|
||||
};
|
||||
|
||||
union soldat{
|
||||
unsigned short int durabilite;
|
||||
unsigned short int deplacement;
|
||||
unsigned short int defense;
|
||||
unsigned short int degat;
|
||||
unsigned short int distance;
|
||||
};
|
||||
|
||||
void createSoldat(soldat* soldat){
|
||||
soldat->durabilite = 7;
|
||||
soldat->deplacement = 7;
|
||||
soldat->defense = 7;
|
||||
soldat->degat = 7;
|
||||
soldat->distance = 7;
|
||||
}
|
||||
|
||||
int main(void){
|
||||
}
|
23
DEV/DEV1.1_suite/concept_en_vrac/Q2_clubs.c
Normal file
23
DEV/DEV1.1_suite/concept_en_vrac/Q2_clubs.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef enum wedge{PITCHING,GAP,SAND,LOB,FLIP}wedge;
|
||||
typedef enum putter{REGULAR,BELLY,LONG}putter;
|
||||
|
||||
typedef struct categorie{
|
||||
int bois;
|
||||
int fer;
|
||||
wedge wedge;
|
||||
putter putter;
|
||||
}categorie;
|
||||
|
||||
afficheCategorie(categorie categorie){
|
||||
printf("\nbois : %d\n",categorie.bois);
|
||||
printf("fer : %d\n",categorie.fer);
|
||||
printf("wedge : %d\n",categorie.wedge);
|
||||
printf("putter : %d\n\n",categorie.putter);
|
||||
}
|
||||
|
||||
int main(void){
|
||||
return 0;
|
||||
}
|
0
DEV/DEV1.1_suite/concept_en_vrac/Q2_clubs.c~
Normal file
0
DEV/DEV1.1_suite/concept_en_vrac/Q2_clubs.c~
Normal file
Reference in New Issue
Block a user