Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- #include "string.h"
- #define rc() printf("\n");
- typedef struct personne personne;
- struct personne{
- char nom[100];
- char prenom[100];
- char adresse[100];
- int age;
- int garcon; // Booléen : 1 = garçon, 0 = fille
- };
- int main(int argc, char *argv[])
- {
- int i=0;
- for (i=0;i<10;i++){
- personne joueur[i];
- printf("Personne %d : Quel est votre nom ? ",i);
- scanf("%s",&joueur[i].nom);
- printf("Personne %d : Quel est votre prénom ? ",i);
- scanf("%s",&joueur[i].prenom);
- printf("Personne %d : Quel est votre adresse ? ",i);
- scanf("%s",&joueur[i].adresse);
- printf("Personne %d : Quel est votre age ? ",i);
- scanf("%d",&joueur[i].age);
- printf("Personne %d : Êtes-vous un garçon (1) où une fille ? ",i);
- scanf("%d",&joueur[i].garcon);
- printf("\n%d %s %s a %d ans, habite à %s et ",i,joueur[i].prenom,joueur[i].nom,joueur[i].age,joueur[i].adresse);
- if (joueur[i].garcon==1){
- printf("est un garçon.");
- } else printf("est une fille.");
- rc()
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement