30 lines
588 B
C
30 lines
588 B
C
|
// NE MARCHE PAS
|
||
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <string.h>
|
||
|
int main(void) {
|
||
|
char phrase[201],cara;
|
||
|
int taille,nbe,nbcara=0,i,iprov,compte=0;
|
||
|
printf("Saisissez une phrase: ");
|
||
|
fgets(phrase,200,stdin);
|
||
|
taille=strlen(phrase);
|
||
|
for (i=0;i<taille;i++) {
|
||
|
iprov=i;
|
||
|
cara=phrase[i];
|
||
|
if (cara=='e')
|
||
|
nbe++;
|
||
|
while (iprov>=0) {
|
||
|
if (cara==phrase[iprov]) {
|
||
|
compte++;
|
||
|
}
|
||
|
iprov-=1;
|
||
|
}
|
||
|
if (compte==1) {
|
||
|
nbcara++;
|
||
|
}
|
||
|
compte=0;
|
||
|
}
|
||
|
printf("Nombre de e: %d\nNombre de caractere differents: %d",nbe,nbcara-1);
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|