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 42 43 44 45 46 47 48 49 50 51 52 53 54
| #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "if1.h"
#include "if2.h"
#include "if3.h"
int main()
{
char reponse[100];
char personnenom[100];
int contenue = 0;
FILE* fichier = NULL;
FILE* his = NULL;
fichier = fopen("memoir.txt", "r+");
his = fopen("histor.txt", "r+");
printf("Hello \nQuel est votre nom ?\n");
scanf("%s", &personnenom);
fprintf(fichier, "%s", personnenom);
fprintf(his, "nom = %s", personnenom);
fclose(fichier);
printf("Hi ");
fichier = fopen("memoir.txt", "r");
do
{
contenue = fgetc(fichier);
printf("%c", contenue);
} while (contenue != EOF);
printf("\nComment vas tu ?");
scanf("%s", &reponse);
fprintf(his, "reponse = %s", reponse);
if (reponse == "bien")
{
rep1;
}
else if (reponse == "bof")
{
rep2;
}
else if (reponse == "mal")
{
rep3;
}
else
{
printf("je n'ai pas compris");
}
} |
Partager