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
| #include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct occurence_mot
{
char chaine[30];
int nb;
};
void init_mots(struct occurence_mot*tab1,int nb_mot)
{
int i,j,k;
i=0;
while (i < 3)
{
printf("\n Entrez le mot %d :", i + 1);
scanf("%s",tab1[i].chaine);
if (tab1[i].chaine[0] == '\0')
{
printf("Mot %d incorrect - recommencez\n", i + 1);
continue;
}
i++;
}
}
int main(int argc, char *argv[])
{
struct occurence_mot tab1[100];
int nb_mot=0,i;
int taille,tab[100],choix,lon,flag1=0;
char chaine[30];
init_mots(tab1,nb_mot);
for(i=0;i<3;i++)
{
printf("%s \n",tab1[i]);
}
system("pause");
return 0;
} |
Partager