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
| #include<stdio.h>
#include<stdlib.h>
#include<string.h>
main()
{
char ch1[10],ch[10];
int ln;
do
{
printf("ecrire une chaine");
gets(ch1);
ln=strlen(ch1);
}
while (ch1[ln-2]!='e') || (ch1[ln-1]!='r')
ch1[ln-2]='\0';
/*je*/
strcpy(ch2,ch1);
strcat(ch2,"e");
printf("je %s \n",ch2);
/*tu*/
strcpy(ch2,ch1);
strcat(ch2,"es");
printf("tu %s \n",ch2);
/*il*/
strcpy(ch2,ch1);
strcat(ch2,"e");
printf("il %s \n",ch2);
/*nous*/
strcpy(ch2,ch1);
strcat(ch2,"ons");
printf("nous %s \n",ch2);
/*vous*/
strcpy(ch2,ch1);
strcat(ch2,"ez");
printf("vous %s \n",ch2);
/*ils*/
strcpy(ch2,ch1);
strcat(ch2,"ent");
printf("ils %s \n",ch2);
return;
} |
Partager