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
|
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <conio.c>
#include <string.h>
main()
{
int i, motsui=0, longueur;
char question[150],mot[150][150];
printf("tapez une phrase\n");
while(getch() != '\n');
gets(question);
longueur=strlen(question);
for(i=0;i<longueur;i++) //analyse de la phrase
{
if(question[i]==' ' || question[i]==',')
{
motsui++;
}
if(question[i]!=' ' && question[i]!=',')
{
mot[motsui][i]=question[i];
printf("caractere : %c\n mot en execution : %d",mot[motsui][i],motsui);
getch();
}
}
printf("%s",mot[1]); //il ne m'affiche rien ..
getch();
}
}
} |