37 lines
641 B
C
37 lines
641 B
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <string.h>
|
||
|
|
||
|
int main(int argc, char const *argv[])
|
||
|
{
|
||
|
char txt[200];
|
||
|
char dejavu[255]={' '};
|
||
|
int dejavuuu=0;
|
||
|
printf("ecriver ici: \n");
|
||
|
fgets(txt,200,stdin);
|
||
|
int nbE=0;
|
||
|
int nbC=0;
|
||
|
for (int i = 0; i < strlen(txt); ++i)
|
||
|
{
|
||
|
if(txt[i]=='e'||txt[i]=='E')
|
||
|
{
|
||
|
nbE++;
|
||
|
}
|
||
|
dejavuuu=0;
|
||
|
for (int j = 0; j < strlen(dejavu); ++j)
|
||
|
{
|
||
|
if (txt[i]==dejavu[j])
|
||
|
{
|
||
|
dejavuuu++;
|
||
|
}
|
||
|
}
|
||
|
if (dejavuuu==0)
|
||
|
{
|
||
|
nbC++;
|
||
|
dejavu[nbC-1]=txt[i];
|
||
|
}
|
||
|
}
|
||
|
printf("Il y a %d nombre de E ou e dans le texte entrée.\nIl y a %d nombre de charactere dans le texte.\n",nbE,nbC-1);
|
||
|
|
||
|
return 0;
|
||
|
}
|