Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * exo4.c
- *
- * Created on: 26 nov. 2015
- * Author: omarou
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #define NBC 6
- #define NBM 20
- void SaisieVerbe (char tab[],int *nb){
- do {
- printf("Entrée : ");
- scanf("%s",tab);
- *nb=strlen(tab);
- } while (tab[*nb-2]!='e' && tab[*nb-1]!='r');
- }
- void Conjug (char tab[],int nb,char *tabterm[],char *tabsuj[]) {
- int i;
- for(i=0;i<NBC;i++) {
- int j;
- printf("%s",tabsuj[i]);
- for(j=0;j<nb-2;j++) printf("%c",tab[j]);
- printf("%s\n\t",tabterm[i]);
- }
- }
- int main(){
- char *tabterm[] = {"e","es","e","ons","ez","ent"};
- char *tabsuj[] = {"Je","Tu","Il","Nous","Vous","Ils"};
- char tab[NBM];
- int nb;
- SaisieVerbe(tab,&nb);
- printf("Sortie : ");
- Conjug(tab,nb,tabterm,tabsuj);
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement