Skip to content

Instantly share code, notes, and snippets.

@tolotratlt
Last active October 19, 2020 20:50
Show Gist options
  • Save tolotratlt/5156167 to your computer and use it in GitHub Desktop.
Save tolotratlt/5156167 to your computer and use it in GitHub Desktop.
Masculin/Féminin permet de convertir un mot masculin se terminant en "teur" par "trice" et vice-versa, sans toutefois vérifier la véracité du mot par exemple : perturbateur -> perturbatriceperturbatrice -> perturbateur. Programme 32 bit seulement.
#include <stdio.h>
#include <stdlib.h>
int main()
{
char szMots[254], *p;
scanf("%s", szMots);
for(p=szMots; *p !='\0'; p++);
*(p+1) = 0;//utile
(*((unsigned int*)(p-sizeof(unsigned int))) == 0x65636972) ? (*((unsigned int*)(p-sizeof(unsigned int))) = 0x00727565) : (*((unsigned int*)(p-sizeof(unsigned int)+1)) = 0x65636972);
printf(">> %s : %s\n\n",((!(*p))?"masculin":"feminin"),szMots);
system("pause");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment