begin process at 2012 02 12 12:27:13
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Application

 > BLACKJACK SIMPLE AVEC DEV-CPP

BLACKJACK SIMPLE AVEC DEV-CPP


 Information sur la source

Note :
8 / 10 - par 1 personne
8,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Application Classé sous :blackjack, blackjack Niveau :Débutant Date de création :08/02/2007 Vu / téléchargé :3 075 / 178

Auteur : desdemonias

Ecrire un message privé
Site perso
Commentaire sur cette source (5)
Ajouter un commentaire et/ou une note

 Description

Et oui, encore un BlackJack avec Dev-cpp en  interface DOS.

Source

  • #include <iostream>
  • #include <cstdlib>
  • #include <algorithm>
  • #include <ctime>
  • #include <cctype>
  • typedef enum { Trefles = 0, Carreaux, Coeur, Pike } Suit;
  • typedef enum { Continue, Win, Bust } State;
  • typedef struct {
  • Suit suit;
  • char value;
  • } Card;
  • class Deck {
  • public:
  • Deck() {
  • cards = new Card[52];
  • CreateDeck();
  • }
  • ~Deck() {
  • delete[] cards;
  • }
  • void CreateDeck() {
  • for(int x = 0; x < 4; ++x) {
  • for(int i = 1; i <= 13; ++i) {
  • cards[i + (x * 13) - 1].suit = static_cast<Suit>(x);
  • cards[i + (x * 13) - 1].value = i;
  • }
  • }
  • deck = 52;
  • MelangeDeck();
  • }
  • void MelangeDeck() {
  • for(int x = 0; x < 4; ++x) {
  • for(int i = 1; i <= 13; ++i) {
  • std::swap(cards[i + (x * 13) - 1], cards[rand() % 52]);
  • }
  • }
  • int melange = 3;
  • do {
  • for(int x = 0; x < 2; ++x) {
  • for(int i = 1; i < 13; ++i) {
  • std::swap(cards[i + (x * 13) - 1], cards[(i+2) + (x * 13)]);
  • }
  • }
  • } while(--melange);
  • }
  • Card DrawCard() {
  • if(deck <= 0) {
  • Card c = { static_cast<Suit>(-1), 0 };
  • return c;
  • }
  • return cards[--deck];
  • }
  • void ShowCard(int i) {
  • ShowCard(cards[i]);
  • }
  • void ShowCard(Card card) {
  • Suit suit = card.suit;
  • int value = card.value;
  • switch(value) {
  • case 1: std::cout << "As de "; break;
  • case 11: std::cout << "Chevalier de "; break;
  • case 12: std::cout << "Renne de "; break;
  • case 13: std::cout << "Roi de "; break;
  • default: std::cout << value << " de ";
  • }
  • switch(suit) {
  • case Trefles: std::cout << "Trefles"; break;
  • case Carreaux: std::cout << "Carreaux"; break;
  • case Coeur: std::cout << "Coeur"; break;
  • case Pike: std::cout << "Pike"; break;
  • }
  • std::cout << std::endl;
  • }
  • private:
  • Card *cards;
  • int deck;
  • };
  • class BlackJack : public Deck {
  • public:
  • BlackJack() {
  • croupier.score = croupier.index = 0;
  • croupier.cards = new Card[12];
  • joueur.score = joueur.index = 0;
  • joueur.cards = new Card[12];
  • }
  • ~BlackJack() {
  • delete[] croupier.cards;
  • delete[] joueur.cards;
  • }
  • State give_joueur_card(void) {
  • Card card = this->DrawCard();
  • if(!card.value)
  • return Bust;
  • joueur.cards[joueur.index++] = card;
  • joueur.score = count_cards(joueur.cards, joueur.index);
  • if(joueur.score > 21)
  • return Bust;
  • else if(joueur.score == 21)
  • return Win;
  • return Continue;
  • }
  • State give_croupier_card(void) {
  • Card card = this->DrawCard();
  • if(!card.value)
  • return Bust;
  • croupier.cards[croupier.index++] = card;
  • croupier.score = count_cards(croupier.cards, croupier.index);
  • if(croupier.score > 21)
  • return Bust;
  • else if(joueur.score == 21)
  • return Win;
  • return Continue;
  • }
  • void show_joueur_cards(void) {
  • std::cout << " Cartes du joueur" << std::endl;
  • ShowCards(joueur.cards, joueur.index);
  • std::cout << std::endl;
  • }
  • void show_croupier_cards(bool show_all) {
  • std::cout << " Cartes du Croupier" << std::endl;
  • if(show_all) {
  • ShowCards(croupier.cards, croupier.index);
  • std::cout << "Score: " << croupier.score;
  • } else
  • ShowCards(croupier.cards+1, croupier.index-1);
  • std::cout << std::endl;
  • }
  • int get_joueur_score(void) { return joueur.score; }
  • int get_croupier_score(void) { return croupier.score; }
  • void ShowCards(Card *cards, int size) {
  • for(int i = 0; i < size; ++i)
  • ShowCard(cards[i]);
  • }
  • private:
  • struct {
  • int score, index;
  • Card *cards;
  • } croupier, joueur;
  • int count_cards(Card *cards, int size) {
  • int total = 0;
  • bool CAs = false;
  • for(int i = 0; i < size; ++i) {
  • if(CAs && size > 2) {
  • total -= 10;
  • CAs = false;
  • }
  • if(cards[i].value == 1) {
  • if((total + 11) < 21) {
  • total += 10;
  • CAs = true;
  • }
  • ++total;
  • } else if(cards[i].value >= 10)
  • total += 10;
  • else
  • total += cards[i].value;
  • }
  • return total;
  • }
  • };
  • int main(void)
  • {
  • srand(time(0));
  • BlackJack *jack = new BlackJack();
  • bool busted = false, joueur_hit = true;
  • State croup, joueur;
  • std::string message = "";
  • jack->give_croupier_card();
  • jack->give_joueur_card();
  • do {
  • int cscore = jack->get_croupier_score();
  • if(cscore < 15) croup = jack->give_croupier_card();
  • if(joueur_hit) joueur = jack->give_joueur_card();
  • int jscore = jack->get_joueur_score();
  • char b = 0;
  • if(jscore <= 21 && cscore <= 21) {
  • do {
  • jack->show_croupier_cards(false);
  • jack->show_joueur_cards();
  • std::cout << "Que voulez vous faire? " << jscore << ") [P=Prendre/L=Laisser] ";
  • std::cin >> b; b = std::toupper(b);
  • } while(b != 'P' && b != 'L');
  • }
  • joueur_hit = (b == 'P');
  • if(!joueur_hit) {
  • while(cscore < 15) {
  • croup = jack->give_croupier_card();
  • cscore = jack->get_croupier_score();
  • }
  • if(jscore > cscore || joueur == Win || croup == Bust)
  • message = "Gagnant!!!";
  • else if(cscore > jscore || croup == Win || joueur == Bust)
  • message = "Perdu";
  • else if(cscore == jscore)
  • message = "Dommage";
  • break;
  • }
  • busted = (joueur == Bust || croup == Bust);
  • } while(!busted);
  • std::cout << "+---- " << message << " ----+" << std::endl << std::endl;
  • jack->show_croupier_cards(true);
  • std::cout << std::endl;
  • jack->show_joueur_cards();
  • std::cout << "Score: " << jack->get_joueur_score() << std::endl;
  • system("pause");
  • return 0;
  • }
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <ctime>
#include <cctype>

typedef enum { Trefles = 0, Carreaux, Coeur, Pike } Suit;
typedef enum { Continue, Win, Bust } State;
typedef struct  {
	Suit suit;
	char value;
} Card;


class Deck {
public:
	Deck() {
		cards = new Card[52];
		CreateDeck();
	}

	~Deck() {
		delete[] cards;
	}

	void CreateDeck() {
		for(int x = 0; x < 4; ++x) {
			for(int i = 1; i <= 13; ++i) {
				cards[i + (x * 13) - 1].suit = static_cast<Suit>(x);
				cards[i + (x * 13) - 1].value = i;
			}
		}
		deck = 52;
		MelangeDeck();
	}
			
	void MelangeDeck() {
		for(int x = 0; x < 4; ++x) {
			for(int i = 1; i <= 13; ++i) {
				std::swap(cards[i + (x * 13) - 1], cards[rand() % 52]);
			}
		}

		int melange = 3;
		do { 
			for(int x = 0; x < 2; ++x) { 
				for(int i = 1; i < 13; ++i) { 
					std::swap(cards[i + (x * 13) - 1], cards[(i+2) + (x * 13)]);
				}
			}
		} while(--melange);
	}

	Card DrawCard() {
		if(deck <= 0) {
			Card c = { static_cast<Suit>(-1), 0 };
			return c;
		}
		return cards[--deck];
	}

	void ShowCard(int i) {
		ShowCard(cards[i]);
	}

	void ShowCard(Card card) {
		Suit suit = card.suit;
		int value = card.value;

		switch(value) {
			case 1: std::cout << "As de "; break;
			case 11: std::cout << "Chevalier de "; break;
			case 12: std::cout << "Renne de "; break;
			case 13: std::cout << "Roi de "; break;
			default: std::cout << value << " de ";
		}

		switch(suit) {
			case Trefles: std::cout << "Trefles"; break;
			case Carreaux: std::cout << "Carreaux"; break;
			case Coeur: std::cout << "Coeur"; break;
			case Pike: std::cout << "Pike"; break;
		}
		std::cout << std::endl;
	}

private:
	Card *cards;
	int deck;
};

class BlackJack : public Deck {
public:
	BlackJack() {
		croupier.score = croupier.index = 0;
		croupier.cards = new Card[12];

		joueur.score = joueur.index = 0;
		joueur.cards = new Card[12];
	}

	~BlackJack() {
		delete[] croupier.cards;
		delete[] joueur.cards;
	}

	State give_joueur_card(void) {
		Card card = this->DrawCard();
		if(!card.value)
			return Bust;

		joueur.cards[joueur.index++] = card;
		joueur.score = count_cards(joueur.cards, joueur.index);

		if(joueur.score > 21)
			return Bust;
		else if(joueur.score == 21)
			return Win;

		return Continue;
	}

	State give_croupier_card(void) {
		Card card = this->DrawCard();
		if(!card.value)
			return Bust;

		croupier.cards[croupier.index++] = card;
		croupier.score = count_cards(croupier.cards, croupier.index);

		if(croupier.score > 21)
			return Bust;
		else if(joueur.score == 21)
			return Win;

		return Continue;
	}

	void show_joueur_cards(void) {
		std::cout << "         Cartes du joueur" << std::endl;
		ShowCards(joueur.cards, joueur.index);
		std::cout << std::endl;
	}

	void show_croupier_cards(bool show_all) {
		std::cout << "         Cartes du Croupier" << std::endl;
		if(show_all) {
			ShowCards(croupier.cards, croupier.index);
			std::cout << "Score: " << croupier.score;
		} else
			ShowCards(croupier.cards+1, croupier.index-1);

		std::cout << std::endl;
	}

	int get_joueur_score(void) { return joueur.score; }
	int get_croupier_score(void) { return croupier.score; }

	void ShowCards(Card *cards, int size) {
		for(int i = 0; i < size; ++i)
			ShowCard(cards[i]);
	}

private:
	struct {
		int score, index;
		Card *cards;
	} croupier, joueur;

	int count_cards(Card *cards, int size) {
		int total = 0;
		bool CAs = false;

		for(int i = 0; i < size; ++i) {
			if(CAs && size > 2) {
				total -= 10;
				CAs = false;
			}

			if(cards[i].value == 1) {
				if((total + 11) < 21) {
					total += 10;
					CAs = true;
				}
				++total;
			} else if(cards[i].value >= 10)
				total += 10;
			else
				total += cards[i].value;
		}
		return total;
	}
};


int main(void)
{
	srand(time(0));
	BlackJack *jack = new BlackJack();
	bool busted = false, joueur_hit = true;
	State croup, joueur;
	std::string message = "";

	jack->give_croupier_card();
	jack->give_joueur_card();

	do { 
		int cscore = jack->get_croupier_score();
		if(cscore < 15) croup = jack->give_croupier_card();

		if(joueur_hit) joueur = jack->give_joueur_card();
		int jscore = jack->get_joueur_score();

		char b = 0;
		if(jscore <= 21 && cscore <= 21) {
			do {
				jack->show_croupier_cards(false);
				jack->show_joueur_cards();

				std::cout << "Que voulez vous faire?  " << jscore << ") [P=Prendre/L=Laisser] ";
				std::cin >> b; b = std::toupper(b);
			} while(b != 'P' && b != 'L');
		}
		joueur_hit = (b == 'P');

		if(!joueur_hit) {
			while(cscore < 15) {
				croup = jack->give_croupier_card();
				cscore = jack->get_croupier_score();
			}

			if(jscore > cscore || joueur == Win || croup == Bust)
				message = "Gagnant!!!";
			else if(cscore > jscore || croup == Win || joueur == Bust)
				message = "Perdu";
			else if(cscore == jscore)
				message = "Dommage";

			break;
		}
		busted = (joueur == Bust || croup == Bust);
	} while(!busted);

	std::cout << "+---- " << message << " ----+" << std::endl << std::endl;

	jack->show_croupier_cards(true);
	std::cout << std::endl;

	jack->show_joueur_cards();
	std::cout << "Score: " << jack->get_joueur_score() << std::endl;
              system("pause");
	return 0;
	
}


 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 Sources de la même categorie

Source avec Zip Source avec une capture CONTACTS MANAGER par eapaceinfo
Source avec Zip Source avec une capture CONTACTES BOOK par mature
Source avec Zip Source avec une capture [C++/QT] SLIDEALWAYS, RÉALISEZ DES SLIDES POUR VOTRE SITE AV... par doderic
Source avec Zip Source avec une capture MAILLAGE 3D (VTK + QT) par ammoun007
Source avec Zip Source avec une capture CONVHTML : UN UTILITAIRE DE CONVERSION POUR FICHIERS HTML par pgl10

 Sources en rapport avec celle ci

Source avec Zip Source avec une capture BLACKJACK AVEC ALLEGRO par julus_julus

Commentaires et avis

Commentaire de Renfield le 08/02/2007 12:58:02 administrateur CS

Merci de cesser ce bla bla inutile, SMS qui plus est...

utilisez MSN ou tout autre moyen a votre convenance, ne polluez pas inutilement CodeS-SourceS

Merci.
Renfield - Admin CS

Commentaire de BruNews le 08/02/2007 13:10:55 administrateur CS

C'est nettoyé.

Commentaire de saoudi86 le 16/02/2007 12:54:08

salut a tous les ames de cppfrance
je suis saoudi abderrazzak de maroc je veux propose mon projet de la fine de l'anneé dernier en cpp
merci..

Commentaire de saoudi86 le 16/02/2007 12:58:12

saoudi abderrazzak
voila mon projet:
*************************************************************
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
#include<stdlib.h>
#include<string.h>
#include<stdio.h>
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <dos.h>
#define angle M_PI/180

/*
** Fonction permettant l'initialisation graphique
*/

void Initialisation_graphique(void){
  int GDriver = DETECT,GMode,ErrorCode;
  initgraph( &GDriver, &GMode, " " );
  ErrorCode = graphresult();
  if( ErrorCode != grOk )
   {
printf(" Graphics System Error: %s\n", grapherrormsg( ErrorCode ) );
getch();
exit( 1 );
   }
}
/*
** Fonction pour dessiner par pixel dans une forme rectangulaire
*/
void dessine(int x1,int y1,int x2, int y2,int coul){
int i,j;
for(i=x1;i<=x2;i++)
for(j=y1;j<=y2;j++)
    putpixel(i,j,coul);
}
/*
** Cette fonction revoie le mois en charact‚re
** Corresspodant … l'entier en param‚tre.
*/

char * det_mois(int val){
     if(val==1) return("Janvier");
     if(val==2) return("F‚vrier");
     if(val==3) return("Mars");
     if(val==4) return("Aril");
     if(val==5) return("Mai");
     if(val==6) return("Juin");
     if(val==7) return("Juillet");
     if(val==8) return("Ao–t");
     if(val==9) return("Septembre");
     if(val==10) return("Octobre");
     if(val==11) return("Novembre");
     if(val==12) return("D‚cembre");

return(" ");
}

/*
** Comme son nom l'indique cette fonction
** permet d'afficher la date du jour.
*/
void affiche_date_du_jour(date la_date,char* num){

      getdate(&la_date);

      gcvt(la_date.da_day,3,num);
      settextstyle(2,0,4);
      setcolor(15);
      outtextxy(240,47,num);
      outtextxy(260,47,det_mois(la_date.da_mon));

      gcvt(la_date.da_year,5,num);
      settextstyle(2,0,4);
      setcolor(15);
      outtextxy(320,47,num);

}

/*
** C'est par cette fonction que les nombreux rectangles
** du programme sont construits
*/

void decoration(void){
      bar3d(getmaxx()-40,20,getmaxx()-20,450,0,0);
      rectangle(getmaxx()-35,25,getmaxx()-25,445);
      rectangle(getmaxx()-35+2,25+2,getmaxx()-25-2,445-2);
      bar3d(20,20,40,450,0,0);
      rectangle(25,25,35,445);
      rectangle(27,27,33,443);
      bar3d(60,417,getmaxx()-60,440,0,0);
      rectangle(65,422,getmaxx()-65,435);
      rectangle(70,427,getmaxx()-70,430);

      setfillstyle(8,9);
      bar3d(95,30,550,150,4,4);

      setfillstyle(1,9);
      bar3d(getmaxx()-60,30,getmaxx()-80,150,0,0);
      rectangle(getmaxx()-62,32,getmaxx()-78,148);
}

/*
** C'est par cette foction avec l'itulisation
** de la pr‚c‚dente que le plateau du programme
** prend forme.
*/

void dessine_plateau(void){
      setfillstyle(7,4);
      bar3d(10,10,getmaxx()-10,getmaxy()-10,0,0);

      setfillstyle(11,9);
      bar3d(50,20,getmaxx()-50,160,0,0);
      rectangle(55,25,getmaxx()-55,155);
      bar3d(50,170,getmaxx()-50,450,0,0);
      rectangle(55,175,getmaxx()-55,445);

      decoration();

      bar3d(230,70,515,100,0,0);
      rectangle(232,72,513,98);
      setcolor(0);
      rectangle(234,75,511,96);
      setcolor(15);

      setfillstyle(1,9);
      bar3d(230,37,515,65,1,1);
      rectangle(232,39,513,63);
      setcolor(0);
      rectangle(234,42,511,61);
      setcolor(15);

      bar3d(230,105,515,130,0,0);
      rectangle(232,107,513,128);
      setcolor(15);

      settextstyle(4,0,1);
      outtextxy(105,70,"Il est       :");
      outtextxy(100,40,"Date du Jour :");
      outtextxy(238,138," gestion d'affectation des stages");

      outtextxy(getmaxx()-76,40,"E");
      outtextxy(getmaxx()-76,60,"X");
      outtextxy(getmaxx()-76,80,"I");
      outtextxy(getmaxx()-76,100,"T");

}

/*
** L… la montre prend forme graphiquement
** avec le cadre et le cercle
*/
void forme_montre(void){

      setfillstyle(1,9);
      bar3d(230,200,415,410,0,0);
      bar3d(160,200,215,410,0,0);
      bar3d(430,200,485,410,0,0);
      rectangle(235,205,410,405);
      bar3d(95,200,150,410,0,0);
      bar3d(495,200,550,410,0,0);
      setcolor(15);
      rectangle(95,200,150,410);
      rectangle(96,201,149,409);
      rectangle(495,200,550,410);
      rectangle(496,201,549,409);
      rectangle(160,200,215,410);
      rectangle(161,201,214,409);
      rectangle(430,200,485,410);
      rectangle(431,201,484,409);
      setcolor(0);
      rectangle(236,207,409,404);
      setcolor(15);
      circle(320,300,70);
      settextstyle(2,0,4);
      outtextxy(320,372,"6");
      outtextxy(315,215,"12");
      outtextxy(280,360,"7");
      outtextxy(355,225,"1");
      outtextxy(385,250,"2");
      outtextxy(250,330,"8");
      outtextxy(240,293,"9");
      outtextxy(245,255,"10");
      outtextxy(273,225,"11");
      outtextxy(397,293,"3");
      outtextxy(390,325,"4");
      outtextxy(360,360,"5");
      for(int m=1;m<=12;m++){
setcolor(0);
int tirx=320+70*sin(m*30*angle);
int tiry=292-70*cos(m*30*angle);
outtextxy(tirx,tiry,".");
}
      setcolor(15);

}

/*
** Toutes les fonctions pr‚c‚dentes
** sont appel‚es ici.
*/
void erogonomie_centrale(void){
      int i;
      char*num=(char*)malloc(10*sizeof(char));
      struct date la_date;

      dessine_plateau();
      forme_montre();
      settextstyle(5,1,1);
      setcolor(1);
      outtextxy(130,210,"SAOUDI ABDERRAZZAK ");
      outtextxy(520,250,"MARZOUKI JAWAD");
      settextstyle(4,0,1);
      setcolor(10);
      outtextxy(166,220,"  *");
      outtextxy(435,220,"  *");

      for(i=10;i<170;i+=20){
outtextxy(168,230+i,"* * *");
outtextxy(170,220+i," . .");
outtextxy(437,230+i,"* * *");
outtextxy(439,220+i," . .");
      }

      //Affichage de la date du jour
      affiche_date_du_jour(la_date,num);
      setlinestyle(0,0,3);
}

void montre(void){
int minutes,sec,heu,xminutes,
    yminutes,xheu,yheu,xsec,
    ysec,attendre,traitx,traity,
    varchar,ok,nbout,xs,ys,bg,bd;
char*num=(char*)malloc(10*sizeof(char));
char chaine[3];
struct  time Heure_actuelle;
xminutes=320+40*sin(minutes*6*angle);
yminutes=300-40*cos(minutes*6*angle);
xheu=320+30*sin(minutes*0.5*angle+(heu*30*angle));
yheu=300-30*cos(minutes*0.5*angle+(heu*30*angle));
erogonomie_centrale();
do{
gettime(&Heure_actuelle);
sec=Heure_actuelle.ti_sec;
minutes=Heure_actuelle.ti_min;
heu=Heure_actuelle.ti_hour;
attendre=sec;
setcolor(15);
settextstyle(4,0,1);
outtextxy(305,286,"751");

dessine(238,76,250,87,9);
gcvt(heu,3,num);
settextstyle(2,0,4);
setcolor(15);
outtextxy(240,77,num);
outtextxy(260,77,"heure(s)");

dessine(308,76,320,87,9);
gcvt(minutes,3,num);
settextstyle(2,0,4);
setcolor(15);
outtextxy(310,77,num);
outtextxy(330,77,"minute(s)");

dessine(393,76,405,87,9);
gcvt(sec,3,num);
settextstyle(2,0,4);
setcolor(15);
outtextxy(395,77,num);
outtextxy(415,77,"seconde(s)");

//Affichage aiguille des heures
setcolor(9);
line(320,300,xheu,yheu);
xheu=320+30*sin(minutes*0.5*angle+(heu*30*angle));
yheu=300-30*cos(minutes*0.5*angle+(heu*30*angle));
setcolor(4);
line(320,300,xheu,yheu);

//Affichage aiguille des minutes
setcolor(9);
line(320,300,xminutes,yminutes);
xminutes=320+40*sin(minutes*6*angle);
yminutes=300-40*cos(minutes*6*angle);
setcolor(2);
line(320,300,xminutes,yminutes);

//Affichage aiguille des secondes
xsec=320+60*sin((sec)*6*angle);
ysec=300-60*cos((sec)*6*angle);
setcolor(14);
line(320,300,xsec,ysec);

while(1){
gettime(&Heure_actuelle);
sec=Heure_actuelle.ti_sec;
if(attendre!=sec) break;
}
setcolor(9);
line(320,300,xsec,ysec);
settextstyle(2,0,4);
} while(!kbhit());
}


void m(void){

Initialisation_graphique();

montre();

closegraph();
}

/***********************structure soci‚t‚*************************/
  int    bool;
struct societe
{
char adresses[40];
char Email[20];
char tele[20];
char fax[40];
char patente[20];
char categorie[20];
char    sigle[20];

};
societe so;
FILE *a,*b,*f2;
char sigle[20];char adresse[20];char   Email[20];char  tel[20];
char fax[40];char patente[20];char categorie[20];char choix  ;
char rep;
char siglem[20];
char adressesm[20];
char Emailm[20];
char telem[20];
char faxm[40];
char patentem[20];
char categoriem[20];

  /***********************structure stagiaire*************************/

struct     stagiaire
{
char        Prenom [20];
char            nomst[20];
char    ninscription[20];
char            adresse[20];
char           filiere[20];
char          daten[20];
} st;
FILE           *f,*s,*f1;

char        Prenom [20];
char            nomst[20];
char    ninscription[20];

char           filiere[20];
char          daten[20];


char        Prenomm [20];
char            nomstm[20];
char    ninscriptionm[20];
char            adressem[20];
char           filierem[20];
char          datenm[20];
/***********************structure affectation***********************/
    struct affectation
    {
    char numaf[20];
    char dateaf[10];
    char        Prenom [20];
    char            nomst[20];
    char    ninscription[20];
    char categorie[20];
    char    sigle[20];
    }aff;
     char numaf[20];
    char dateaf[10];
    char numafm[20];
    char dateafm[10];

/**************************fonction menu1********************************/
void         menu()
{
textbackground(1);
clrscr();
gotoxy(4,5) ;printf("  ÉÍÍÍÍ»                                                            ÉÍÍÍÍ»");
gotoxy(4 ,6);printf(" ɼ   ɼ                                                            È»   È»");
gotoxy(4 ,7);printf("ɼ    º                    GESTION DES STAGIAIRES                    º    È»");
gotoxy(4 ,8);printf("º     È»                                                            É¼     º");
gotoxy(4 ,9);printf("º      ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ      º");
gotoxy(4,10);printf("º                                                                          º");
gotoxy(4,11);printf("º                                                                          º");
gotoxy(4,12);printf("º                                                                          º");
gotoxy(4,13);printf("º     ÉÍÍÍÍÍÍÍÍÍÍÍ»         ÉÍÍÍÍÍÍÍÍÍÍÍ»         ÉÍÍÍÍÍÍÍÍÍÍÍ»            º");
gotoxy(4,14);printf("º    É¼           È»       ɼ           È»       ɼ           È»           º");
gotoxy(4,15);printf("º   ɼ             È»     ɼ             È»     ɼ             È»          º");
gotoxy(4,16);printf("º   º [A]® Ajoutter º     º[R]® Rechercherº     º [L]® Lister   º          º");
gotoxy(4,17);printf("º   È»             ɼ     È»             ɼ     È»             ɼ          º");
gotoxy(4,18);printf("º    È»           ɼ       È»           ɼ       È»           ɼ           º");
gotoxy(4,19);printf("º     ÈÍÍÍÍÍÍÍÍÍÍͼ         ÈÍÍÍÍÍÍÍÍÍÍͼ         ÈÍÍÍÍÍÍÍÍÍÍͼ            º");
gotoxy(4,20);printf("º     ÉÍÍÍÍÍÍÍÍÍÍÍ»         ÉÍÍÍÍÍÍÍÍÍÍÍ»         ÉÍÍÍÍÍÍÍÍÍÍÍ»            º");
gotoxy(4,21);printf("º    É¼           È»       ɼ           È»       ɼ           È»           º");
gotoxy(4,22);printf("º   ɼ             È»     ɼ             È»     ɼ             È»          º");
gotoxy(4,23);printf("º   º[M]® Modifier  º     º               º     º[S]® Supprimer º          º");
gotoxy(4,24);printf("º   È»             ɼ     È»             ɼ     È»             ɼ          º");
gotoxy(4,25);printf("º    È»           ɼ       È»           ɼ       È»           ɼ           º");
gotoxy(4,26);printf("º     ÈÍÍÍÍÍÍÍÍÍÍͼ         ÈÍÍÍÍÍÍÍÍÍÍͼ         ÈÍÍÍÍÍÍÍÍÍÍͼ            º");
gotoxy(4,27);printf("º                           ÉÍÍÍÍÍÍÍÍÍÍÍ»                                  º");
gotoxy(4,28);printf("º                          É¼           È»                                 º");
gotoxy(4,29);printf("º                         ɼ             È»                                º");
gotoxy(4,30);printf("º                         º[Q]® Quitter   º                                º");
gotoxy(4,31);printf("º                         È»             ɼ                                º");
gotoxy(4,32);printf("º                          È»           ɼ                                 º");
gotoxy(4,33);printf("º                           ÈÍÍÍÍÍÍÍÍÍÍͼ                                  º");
gotoxy(4,34);printf("º                                                                          º");
gotoxy(4,35);printf("º   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»       º");
gotoxy(4,36);printf("º  É¼                                                              È»      º");
gotoxy(4,37);printf("º  º                  ®® TAPEZ VOTRE CHOIX S.V.P [ ] ¯¯             º      º");
gotoxy(4,38);printf("º  È»                                                              É¼      º");
gotoxy(4,39);printf("º   ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ       º");
gotoxy(4,40);printf("º                                                                          º");
gotoxy(4,41);printf("È»                                                                        É¼");
gotoxy(4,42);printf(" È»                                                                      É¼");
gotoxy(4,43);printf("  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ");
textcolor(4);
gotoxy(11,16);textcolor(14+BLINK);cprintf("A");
gotoxy(32,16);textcolor(14+BLINK);cprintf("R");
gotoxy(55,16);textcolor(14+BLINK);cprintf("L");
gotoxy(10,23);textcolor(14+BLINK);cprintf("M");
gotoxy(54,23);textcolor(14+BLINK);cprintf("S");
gotoxy(32,30);textcolor(14+BLINK);cprintf("Q");
gotoxy(34,23);textcolor(14+BLINK);cprintf("BIENVENUE");
textcolor(7);
}
/***************************************************************************/
/*                          GESTION DES STAGIAIRES                        */
/*************************************************************************/
/**********************fonction ajouter*********************/
void          ajouterstg()
{
do
{
flushall();
clrscr();
f=fopen("c:\\stag.txt","a+");
    if(f==NULL)
    {f=fopen("c:\\stag.txt","w");}
gotoxy(13,6); printf("ÉÍËÍ»   ÉÍËÍ»                               ÉÍËÍ»   ÉÍËÍ»       \n");
gotoxy(13,7); printf("ÌÍÎ͹   ÌÍÎ͹                               ÌÍÎ͹   ÌÍÎ͹       \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ                               ÈÍÊͼÉÍ»ÈÍÊͼ       \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ»                               ÉÍËÍ»ÈÍ»ÉÍËÍ»       \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹                               ÌÍÎ͹ÈͼÌÍÎ͹       \n");
gotoxy(13,11);printf("ÈÍÊͼ   ÈÍÊͼ                               ÈÍÊͼ   ÈÍÊͼ       \n");
gotoxy(6,12);printf("                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                  \n");
gotoxy(6,13);printf("                   º                              º                  \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  °                        °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ           º                              º         ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ               º º\n");
gotoxy(6,17);printf("º º                                                               º º\n");
gotoxy(6,18);printf("º                        °    STAGIAIRE   °                         º\n");
gotoxy(6,19);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,20);printf("º    Nø Inscription  :                                              º\n");
gotoxy(6,21);printf("º                                                                   º\n");
gotoxy(6,22);printf("º    Nom Stagiaire   :                                              º\n");
gotoxy(6,23);printf("º                                                                   º\n");
gotoxy(6,24);printf("º    Pr‚nom stagiaire:                                              º\n");
gotoxy(6,25);printf("º                                                                   º\n");
gotoxy(6,26);printf("º    Date Naissance  :                                              º\n");
gotoxy(6,27);printf("º                                                                   º\n");
gotoxy(6,28);printf("º   Adresse          :                                              º\n");
gotoxy(6,29);printf("º                                                                   º\n");
gotoxy(6,30);printf("º   Fili‚re          :                                              º\n");
gotoxy(6,31);printf("º º                                                               º º\n");
gotoxy(6,32);printf("º º                                                               º º\n");
gotoxy(6,33);printf("º ÈÍÍÍÍÍ              ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»       ÍÍͼ º\n");
gotoxy(6,34);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ VOULEZ VOUS AJOUTER UNE AUTRE  ÌÍÍÍÍÍÍÍÍÍÍÍͼ\n");
gotoxy(6,35);printf("                      º          O  [    ]  N          º             \n");
gotoxy(6,36);printf("                      ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ     \n");
gotoxy(30,34);textcolor(14+BLINK);cprintf("VOULEZ VOUS AJOUTER UN AUTRE ");
textcolor(7);

    aq:
    flushall();
    gotoxy(29,20);scanf("%s",&st.ninscription);

bool=0;
     while(!feof(f))
     {flushall();

      fscanf(f,"%s\t%s\t%s\t%s\t%s\t%s\n",ninscription,nomst,Prenom
      ,adresse,daten,filiere);

if(strcmpi(ninscription,st.ninscription)==0)
     {bool=1;
     break;
     }
     }
     if(bool==1)
     {
     gotoxy(29,20);printf("Ce num‚ro existe!!");
     gotoxy(29,20);getch();
     gotoxy(29,20);printf("                   ");
     goto aq;
     }






    gotoxy(29,22);scanf("%s",&st.nomst);
    gotoxy(29,24);scanf("%s",&st.Prenom);
    gotoxy(29,26);scanf("%s",&st.adresse);
    gotoxy(29,28);scanf("%s",&st.daten);
    gotoxy(29,30);scanf("%s",&st.filiere);

    fprintf(f,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);

    fclose(f);
    flushall();
    gotoxy(45,35);scanf("%c",&rep);
    rep=toupper(rep);
    }while(rep!='N');
       }
/**********************fonction supprimer*******************/
void          supprimerstg()

    {
clrscr();
    f=fopen("c:\\stag.txt","r");
    if(f==NULL)
{printf("le fichier est absent\n");
  getch();
  exit(0);
  }

gotoxy(10,12);printf("                  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                 \n");
gotoxy(10,13);printf("                  º                              º                 \n");
gotoxy(10,14);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  ° Nø A SUPPRIMER ?:..... °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n");
gotoxy(10,15);printf("                  º                              º                 \n");
gotoxy(10,16);printf("                  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ                 \n");

gotoxy(52,14);scanf("%s",&ninscription);

    bool=0;
     while(!feof(f))
     {flushall();

fscanf(f,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);

if(strcmpi(ninscription,st.ninscription)==0)
     {bool=1;
     break;
     }
     }
     if(bool==1)
     {
     clrscr();
gotoxy(13,6); printf("ÉÍËÍ»   ÉÍËÍ»                               ÉÍËÍ»   ÉÍËÍ»       \n");
gotoxy(13,7); printf("ÌÍÎ͹   ÌÍÎ͹                               ÌÍÎ͹   ÌÍÎ͹       \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ                               ÈÍÊͼÉÍ»ÈÍÊͼ       \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ»                               ÉÍËÍ»ÈÍ»ÉÍËÍ»       \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹                               ÌÍÎ͹ÈͼÌÍÎ͹       \n");
gotoxy(13,11);printf("ÈÍÊͼ   ÈÍÊͼ                               ÈÍÊͼ   ÈÍÊͼ       \n");
gotoxy(6,12);printf("                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                  \n");
gotoxy(6,13);printf("                   º                              º                  \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  °                        °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ           º                              º         ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ               º º\n");
gotoxy(6,17);printf("º º                                                               º º\n");
gotoxy(6,18);printf("º                        °    STAGIAIRE   °                         º\n");
gotoxy(6,19);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,20);printf("º    Nø Inscription  :                                              º\n");
gotoxy(6,21);printf("º                                                                   º\n");
gotoxy(6,22);printf("º    Nom Stagiaire   :                                              º\n");
gotoxy(6,23);printf("º                                                                   º\n");
gotoxy(6,24);printf("º    Pr‚nom stagiaire:                                              º\n");
gotoxy(6,25);printf("º                                                                   º\n");
gotoxy(6,26);printf("º    Date Naissance  :                                              º\n");
gotoxy(6,27);printf("º                                                                   º\n");
gotoxy(6,28);printf("º   Adresse          :                                              º\n");
gotoxy(6,29);printf("º                                                                   º\n");
gotoxy(6,30);printf("º   Fili‚re          :                                              º\n");
gotoxy(6,31);printf("º º                                                               º º\n");
gotoxy(6,32);printf("º º                                                               º º\n");
gotoxy(6,33);printf("º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º\n");
gotoxy(6,34);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
   gotoxy(29,20);printf("%s",st.ninscription);
    gotoxy(29,22);printf("%s",st.nomst);
    gotoxy(29,24);printf("%s",st.Prenom);
    gotoxy(29,26);printf("%s",st.adresse);
    gotoxy(29,28);printf("%s",st.daten);
    gotoxy(29,30);printf("%s",st.filiere);
  flushall();
  gotoxy(10,40);printf("voulez-vous supprimer(O/N):.........");
  gotoxy(38,40);scanf("%c",&rep);
  rep=toupper(rep);
  if(rep=='O')
  {
    f1=fopen("c:\\stag.txt","r");

  s=fopen("c:\\s.txt","w");
while(!feof(f1))
{
flushall();
// fprintf(f,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);

   fscanf(f1,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);

if(strcmpi(ninscription,st.ninscription)!=0)
fprintf(s,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
}

fclose(f);
f1=fopen("c:\\stag.txt","w");
s=fopen("c:\\s.txt","r");
while(!feof (s))
{

flushall();
fscanf(s,"%s\t%s\t%s\t%s\t%s\t%s\n",&st.ninscription,&st.nomst,&st.Prenom,&st.adresse,&st.daten,&st.filiere);
fprintf(f1,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
}
  }

     }
     else
     {
      clrscr();
     printf("ce numero n'existe pas\n");
     getch();
     }
     getch();

}
/**********************fonction rechercher*****************/
void          rechercherstg()
{
    {clrscr();
    char numst[20];
    f=fopen("c:\\stag.txt","r");
     if(f==NULL)
     {printf("fichier inexistant\n");
     getch();
     exit(0);
     }
     flushall();
gotoxy(10,12);printf("                  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                 \n");
gotoxy(10,13);printf("                  º                              º                 \n");
gotoxy(10,14);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  ° Nø A CHERCHER:........ °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n");
gotoxy(10,15);printf("                  º                              º                 \n");
gotoxy(10,16);printf("                  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ                 \n");

gotoxy(52,14);scanf("%s",&ninscription);
    bool=0;
     while(!feof(f))
     {flushall();

fscanf(f,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);

if(strcmpi(ninscription,st.ninscription)==0)
     {bool=1;
     break;
     }
     }
     if(bool==1)
     {
     clrscr();
gotoxy(13,6); printf("ÉÍËÍ»   ÉÍËÍ»                               ÉÍËÍ»   ÉÍËÍ»       \n");
gotoxy(13,7); printf("ÌÍÎ͹   ÌÍÎ͹                               ÌÍÎ͹   ÌÍÎ͹       \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ                               ÈÍÊͼÉÍ»ÈÍÊͼ       \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ»                               ÉÍËÍ»ÈÍ»ÉÍËÍ»       \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹                               ÌÍÎ͹ÈͼÌÍÎ͹       \n");
gotoxy(13,11);printf("ÈÍÊͼ   ÈÍÊͼ                               ÈÍÊͼ   ÈÍÊͼ       \n");
gotoxy(6,12);printf("                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                  \n");
gotoxy(6,13);printf("                   º                              º                  \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  °                        °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ           º                              º         ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ               º º\n");
gotoxy(6,17);printf("º º                                                               º º\n");
gotoxy(6,18);printf("º                        °    STAGIAIRE   °                         º\n");
gotoxy(6,19);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,20);printf("º    Nø Inscription  :                                              º\n");
gotoxy(6,21);printf("º                                                                   º\n");
gotoxy(6,22);printf("º    Nom Stagiaire   :                                              º\n");
gotoxy(6,23);printf("º                                                                   º\n");
gotoxy(6,24);printf("º    Pr‚nom stagiaire:                                              º\n");
gotoxy(6,25);printf("º                                                                   º\n");
gotoxy(6,26);printf("º    Date Naissance  :                                              º\n");
gotoxy(6,27);printf("º                                                                   º\n");
gotoxy(6,28);printf("º   Adresse          :                                              º\n");
gotoxy(6,29);printf("º                                                                   º\n");
gotoxy(6,30);printf("º   Fili‚re          :                                              º\n");
gotoxy(6,31);printf("º º                                                               º º\n");
gotoxy(6,32);printf("º º                                                               º º\n");
gotoxy(6,33);printf("º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º\n");
gotoxy(6,34);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
   gotoxy(29,20);printf("%s",st.ninscription);
    gotoxy(29,22);printf("%s",st.nomst);
    gotoxy(29,24);printf("%s",st.Prenom);
    gotoxy(29,26);printf("%s",st.adresse);
    gotoxy(29,28);printf("%s",st.daten);
    gotoxy(29,30);printf("%s",st.filiere);



     }
     else
     {
       clrscr();
      printf("ce numero n'existe pas\n");
     getch();
     }
     getch();
     fclose(f);
     }

     }

/**********************fonction lister*********************/
   void          listerstg()
    {clrscr();
    int j;
    f=fopen("c:\\stag.txt","r");
    if(f==NULL)
    {
    printf("le fichier inexistant");
    getch();
    exit(0);
    }
gotoxy(6,8);printf ("ÉÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,9);printf ("ºnøinscripº   nomst   º  pr‚nomst º adressst º     daten  º   filier  º\n");
gotoxy(6,10);printf("ÌÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍ͹\n");
gotoxy(6,11);printf("º         º           º           º          º            º           º\n");
gotoxy(6,12);printf("º         º           º           º          º            º           º\n");
gotoxy(6,13);printf("º         º           º           º          º            º           º\n");
gotoxy(6,14);printf("º         º           º           º          º            º           º\n");
gotoxy(6,15);printf("º         º           º           º          º            º           º\n");
gotoxy(6,16);printf("º         º           º           º          º            º           º\n");
gotoxy(6,17);printf("º         º           º           º          º            º           º\n");
gotoxy(6,18);printf("º         º           º           º          º            º           º\n");
gotoxy(6,19);printf("º         º           º           º          º            º           º\n");
gotoxy(6,20);printf("º         º           º           º          º            º           º\n");
gotoxy(6,21);printf("º         º           º           º          º            º           º\n");
gotoxy(6,22);printf("º         º           º           º          º            º           º\n");
gotoxy(6,23);printf("º         º           º           º          º            º           º\n");
gotoxy(6,24);printf("º         º           º           º          º            º           º\n");
gotoxy(6,25);printf("º         º           º           º          º            º           º\n");
gotoxy(6,26);printf("º         º           º           º          º            º           º\n");
gotoxy(6,27);printf("º         º           º           º          º            º           º\n");
gotoxy(6,28);printf("º         º           º           º          º            º           º\n");
gotoxy(6,29);printf("º         º           º           º          º            º           º\n");
gotoxy(6,30);printf("º         º           º           º          º            º           º\n");
gotoxy(6,31);printf("º         º           º           º          º            º           º\n");
gotoxy(6,32);printf("º         º           º           º          º            º           º\n");
gotoxy(6,33);printf("º         º           º           º          º            º           º\n");
gotoxy(6,34);printf("º         º           º           º          º            º           º\n");
gotoxy(6,35);printf("º         º           º           º          º            º           º\n");
gotoxy(6,36);printf("º         º           º           º          º            º           º\n");
gotoxy(6,37);printf("º         º           º           º          º            º           º\n");
gotoxy(6,38);printf("º         º           º           º          º            º           º\n");
gotoxy(6,39);printf("ÈÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍͼ\n");

      j=0;
     while(!feof(f))
    {
    flushall();
   fscanf(f,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);
    gotoxy(8,11+j);printf("%s",st.ninscription);
    gotoxy(17,11+j);printf("%s",st.nomst);
    gotoxy(29,11+j);printf("%s",st.Prenom);
    gotoxy(41,11+j);printf("%s",st.adresse);
    gotoxy(52,11+j);printf("%s",st.daten);
    gotoxy(65,11+j);printf("%s",st.filiere);
    j++;
   }
   getch();
}

/*********************fonction modifier********************/
void          modifierstg()


{

     clrscr();
     f=fopen("c:\\stag.txt","r");
      if(f==NULL)
      {printf("fichier absent\n");
      getch();
      exit(0);
     }
gotoxy(10,12);printf("                  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                 \n");
gotoxy(10,13);printf("                  º                              º                 \n");
gotoxy(10,14);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  ° Nø A MODIFIER:........ °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n");
gotoxy(10,15);printf("                  º                              º                 \n");
gotoxy(10,16);printf("                  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ                 \n");

gotoxy(52,14);scanf("%s",&ninscription);

  bool=0;
     while(!feof(f))
     {flushall();

fscanf(f,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);

if(strcmpi(ninscription,st.ninscription)==0)
     {bool=1;
     break;
     }
     }
     if(bool==1)
     {
     clrscr();
gotoxy(13,6); printf("ÉÍËÍ»   ÉÍËÍ»                               ÉÍËÍ»   ÉÍËÍ»       \n");
gotoxy(13,7); printf("ÌÍÎ͹   ÌÍÎ͹                               ÌÍÎ͹   ÌÍÎ͹       \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ                               ÈÍÊͼÉÍ»ÈÍÊͼ       \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ»                               ÉÍËÍ»ÈÍ»ÉÍËÍ»       \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹                               ÌÍÎ͹ÈͼÌÍÎ͹       \n");
gotoxy(13,11);printf("ÈÍÊͼ   ÈÍÊͼ                               ÈÍÊͼ   ÈÍÊͼ       \n");
gotoxy(6,12);printf("                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                  \n");
gotoxy(6,13);printf("                   º                              º                  \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  °                        °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ           º                              º         ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ               º º\n");
gotoxy(6,17);printf("º º                                                               º º\n");
gotoxy(6,18);printf("º                        °    STAGIAIRE   °                         º\n");
gotoxy(6,19);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,20);printf("º    Nø Inscription  :                                              º\n");
gotoxy(6,21);printf("º                                                                   º\n");
gotoxy(6,22);printf("º    Nom Stagiaire   :                                              º\n");
gotoxy(6,23);printf("º                                                                   º\n");
gotoxy(6,24);printf("º    Pr‚nom stagiaire:                                              º\n");
gotoxy(6,25);printf("º                                                                   º\n");
gotoxy(6,26);printf("º    Date Naissance  :                                              º\n");
gotoxy(6,27);printf("º                                                                   º\n");
gotoxy(6,28);printf("º   Adresse          :                                              º\n");
gotoxy(6,29);printf("º                                                                   º\n");
gotoxy(6,30);printf("º   Fili‚re          :                                              º\n");
gotoxy(6,31);printf("º º                                                               º º\n");
gotoxy(6,32);printf("º º                                                               º º\n");
gotoxy(6,33);printf("º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º\n");
gotoxy(6,34);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
   gotoxy(29,20);printf("%s",st.ninscription);
    gotoxy(29,22);printf("%s",st.nomst);
    gotoxy(29,24);printf("%s",st.Prenom);
    gotoxy(29,26);printf("%s",st.adresse);
    gotoxy(29,28);printf("%s",st.daten);
    gotoxy(29,30);printf("%s",st.filiere);
getch();
clrscr();
gotoxy(13,6); printf("ÉÍËÍ»   ÉÍËÍ»                               ÉÍËÍ»   ÉÍËÍ»       \n");
gotoxy(13,7); printf("ÌÍÎ͹   ÌÍÎ͹                               ÌÍÎ͹   ÌÍÎ͹       \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ                               ÈÍÊͼÉÍ»ÈÍÊͼ       \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ»                               ÉÍËÍ»ÈÍ»ÉÍËÍ»       \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹                               ÌÍÎ͹ÈͼÌÍÎ͹       \n");
gotoxy(13,11);printf("ÈÍÊͼ   ÈÍÊͼ                               ÈÍÊͼ   ÈÍÊͼ       \n");
gotoxy(6,12);printf("                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                  \n");
gotoxy(6,13);printf("                   º                              º                  \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  °      MODIFICATION      °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ           º                              º         ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ               º º\n");
gotoxy(6,17);printf("º º                                                               º º\n");
gotoxy(6,18);printf("º                        °    STAGIAIRE   °                         º\n");
gotoxy(6,19);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,20);printf("º    Nø Inscription  :                                              º\n");
gotoxy(6,21);printf("º                                                                   º\n");
gotoxy(6,22);printf("º    Nom Stagiaire   :                                              º\n");
gotoxy(6,23);printf("º                                                                   º\n");
gotoxy(6,24);printf("º    Pr‚nom stagiaire:                                              º\n");
gotoxy(6,25);printf("º                                                                   º\n");
gotoxy(6,26);printf("º    Date Naissance  :                                              º\n");
gotoxy(6,27);printf("º                                                                   º\n");
gotoxy(6,28);printf("º   Adresse          :                                              º\n");
gotoxy(6,29);printf("º                                                                   º\n");
gotoxy(6,30);printf("º   Fili‚re          :                                              º\n");
gotoxy(6,31);printf("º º                                                               º º\n");
gotoxy(6,32);printf("º º                                                               º º\n");
gotoxy(6,33);printf("º ÈÍÍÍÍÍ              ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»       ÍÍͼ º\n");
gotoxy(6,34);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹       VOULEZ VOUS MODIFIER     ÌÍÍÍÍÍÍÍÍÍÍÍͼ\n");
gotoxy(6,35);printf("                      º            O  [    ]  N        º             \n");
gotoxy(6,36);printf("                      ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ     \n");

    gotoxy(29,20);scanf("%s",&ninscriptionm);
    gotoxy(29,22);scanf("%s",&nomstm);
    gotoxy(29,24);scanf("%s",&Prenomm);
    gotoxy(29,26);scanf("%s",&adressem);
    gotoxy(29,28);scanf("%s",&datenm);
    gotoxy(29,30);scanf("%s",&filierem);






  flushall();
    gotoxy(45,35);scanf("%c",&rep);
    rep=toupper(rep);
    if(rep=='O')
    {
   f1=fopen("c:\\stag.txt","r");
s=fopen("c:\\s.txt","w");
while(!feof(f1))
{
flushall();
    fscanf(f1,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);

if (strcmpi(st.ninscription,ninscription)==0 )
   fprintf(s,"%s\t%s\t%s\t%s\t%s\t%s\n",ninscriptionm,nomstm
   ,Prenomm,adressem,datenm,filierem);

else
   fprintf(s,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);

}
fclose(f1);
fclose(s);
f1=fopen("c:\\stag.txt","w");
s=fopen("c:\\s.txt","r");
while(!feof(s))
{  flushall();
flushall();
    fscanf(s,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);

fprintf(f1,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);

  }
fclose(f1);
fclose(s);
}

     }
     else
     {
     clrscr();
     printf("ce numero n'existe pas\n");
     getch();
     }








   }

/*********************programme principale*****************/
void         mainstg()
   {
   do   {
       do{clrscr();
  menu();
  gotoxy(54,37);scanf ("%c",&choix);
      choix=toupper (choix);
  }while((choix=='A')&&(choix=='S')&&(choix=='l')&&(choix=='M')&&(choix=='R')
   &&(choix=='Q'));
   switch(choix)
   {case'A':{ajouterstg();
    break;
    }
     case'S':{supprimerstg();
    break;
    }
     case'L':{listerstg();
    break;
    }
    case'M':{modifierstg();
    break;
    }
    case'R':{rechercherstg();
    break;
    }
       }
       }while(choix!='Q');
       }
/***************************************************************************/
/*                          GESTION DES SOCIETES                       */
/*************************************************************************/
/**********************fonction ajouter*********************/
void          ajoutersoc()
    {
do
{
    clrscr();
    flushall();
    a=fopen("c:\\sos.txt","a+");
    if(a==NULL)
    {a=fopen("c:\\sos.txt","w");}
gotoxy(13,6); printf("ÉÍËÍ»   ÉÍËÍ»                               ÉÍËÍ»   ÉÍËÍ»       \n");
gotoxy(13,7); printf("ÌÍÎ͹   ÌÍÎ͹                               ÌÍÎ͹   ÌÍÎ͹       \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ                               ÈÍÊͼÉÍ»ÈÍÊͼ       \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ»                               ÉÍËÍ»ÈÍ»ÉÍËÍ»       \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹                               ÌÍÎ͹ÈͼÌÍÎ͹       \n");
gotoxy(13,11);printf("ÈÍÊͼ   ÈÍÊͼ                               ÈÍÊͼ   ÈÍÊͼ       \n");
gotoxy(6,12);printf("                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                  \n");
gotoxy(6,13);printf("                   º                              º                  \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  °                        °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ           º                              º         ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ               º º\n");
gotoxy(6,17);printf("º º                                                               º º\n");
gotoxy(6,18);printf("º                        °      SOCIETE    °                        º\n");
gotoxy(6,19);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,20);printf("º    sigle           :                                              º\n");
gotoxy(6,21);printf("º                                                                   º\n");
gotoxy(6,22);printf("º    adresse         :                                              º\n");
gotoxy(6,23);printf("º                                                                   º\n");
gotoxy(6,24);printf("º    email           :                                              º\n");
gotoxy(6,25);printf("º                                                                   º\n");
gotoxy(6,26);printf("º    tel             :                                              º\n");
gotoxy(6,27);printf("º                                                                   º\n");
gotoxy(6,28);printf("º   fax              :                                              º\n");
gotoxy(6,29);printf("º                                                                   º\n");
gotoxy(6,30);printf("º   patente          :                                              º\n");
gotoxy(6,31);printf("º                                                                   º\n");
gotoxy(6,32);printf("º   categorie        :                                              º\n");
gotoxy(6,33);printf("º º                                                               º º\n");
gotoxy(6,34);printf("º º                                                               º º\n");
gotoxy(6,35);printf("º ÈÍÍÍÍÍ              ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»       ÍÍͼ º\n");
gotoxy(6,36);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ VOULEZ VOUS AJOUTER UNE AUTRE  ÌÍÍÍÍÍÍÍÍÍÍÍͼ\n");
gotoxy(6,37);printf("                      º          O  [    ]  N          º             \n");
gotoxy(6,38);printf("                      ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ     \n");
textcolor(7);
gotoxy(29,20);scanf("%s",&so.sigle);
gotoxy(29,22);scanf("%s",&so.adresses);
gotoxy(29,24);scanf("%s",&so.Email);
gotoxy(29,26);scanf("%s",&so.tele);
gotoxy(29,28);scanf("%s",&so.fax);
gotoxy(29,30);scanf("%s",&so.patente);
gotoxy(29,32);scanf("%s",&so.categorie);

fprintf(a,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,so.tele,so.fax
,so.patente,so.categorie);



flushall();
gotoxy(44,37);scanf("%c",&rep);
rep=toupper(rep);
}
while(rep!='N');
}
//**********************fonction rechercher*****************/
void          recherchersoc()
{

do
{
clrscr();
    char sigle[20];
    a=fopen("c:\\sos.txt","r");
     if(a==NULL)
     {printf("fichier inexistant\n");
     getch();
     exit(1);
     }
gotoxy(10,12);printf("                  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                 \n");
gotoxy(10,13);printf("                  º                              º                 \n");
gotoxy(10,14);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  ° SIGLE A CHERCHER ?:....  °ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n");
gotoxy(10,15);printf("                  º                              º                 \n");
gotoxy(10,16);printf("                  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ                 \n");
gotoxy(52,14);scanf("%s",&sigle);
     bool=0;
     while(!feof(a))
     {
  fscanf(a,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,so.tele,so.fax
,so.patente,so.categorie);

  if(strcmpi(sigle,so.sigle)==0)
     {bool=1;
     break;
     }
     }
     if(bool==1)
     {
     clrscr();
gotoxy(13,6); printf("ÉÍËÍ»   ÉÍËÍ»                               ÉÍËÍ»   ÉÍËÍ»       \n");
gotoxy(13,7); printf("ÌÍÎ͹   ÌÍÎ͹                               ÌÍÎ͹   ÌÍÎ͹       \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ                               ÈÍÊͼÉÍ»ÈÍÊͼ       \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ»                               ÉÍËÍ»ÈÍ»ÉÍËÍ»       \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹                               ÌÍÎ͹ÈͼÌÍÎ͹       \n");
gotoxy(13,11);printf("ÈÍÊͼ   ÈÍÊͼ                               ÈÍÊͼ   ÈÍÊͼ       \n");
gotoxy(6,12);printf("                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                  \n");
gotoxy(6,13);printf("                   º                              º                  \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  °                        °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ           º                              º         ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ               º º\n");
gotoxy(6,17);printf("º º                                                               º º\n");
gotoxy(6,18);printf("º                        °     SOSIETE    °                         º\n");
gotoxy(6,19);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,20);printf("º    sigle           :                                              º\n");
gotoxy(6,21);printf("º                                                                   º\n");
gotoxy(6,22);printf("º    adresse         :                                              º\n");
gotoxy(6,23);printf("º                                                                   º\n");
gotoxy(6,24);printf("º    email           :                                              º\n");
gotoxy(6,25);printf("º                                                                   º\n");
gotoxy(6,26);printf("º    tel             :                                              º\n");
gotoxy(6,27);printf("º                                                                   º\n");
gotoxy(6,28);printf("º   fax              :                                              º\n");
gotoxy(6,29);printf("º                                                                   º\n");
gotoxy(6,30);printf("º   patente          :                                              º\n");
gotoxy(6,31);printf("º                                                                   º\n");
gotoxy(6,32);printf("º   categorie        :                                              º\n");
gotoxy(6,33);printf("º º                                                               º º\n");
gotoxy(6,34);printf("º º                                                               º º\n");
gotoxy(6,35);printf("º ÈÍÍÍÍÍ              ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»       ÍÍͼ º\n");
gotoxy(6,36);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ VOULEZ VOUS CHERCHER UNE AUTRE ÌÍÍÍÍÍÍÍÍÍÍÍͼ\n");
gotoxy(6,37);printf("                      º          O  [    ]  N          º             \n");
gotoxy(6,38);printf("                      ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ     \n");
textcolor(14+BLINK);
gotoxy(33,3);cprintf("Soci‚t‚");
textcolor(7);
gotoxy(29,20);printf("%s",&so.sigle);
gotoxy(29,22);printf("%s",&so.adresses);
gotoxy(29,24);printf("%s",&so.Email);
gotoxy(29,26);printf("%s",&so.tele);
gotoxy(29,28);printf("%s",&so.fax);
gotoxy(29,30);printf("%s",&so.patente);
gotoxy(29,32);printf("%s",&so.categorie);
}
     else
  {
   clrscr();
gotoxy(25,25);cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(25,26);cprintf("º                          º\n");
gotoxy(25,27);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(12+BLINK);;
gotoxy(28,26);cprintf("ce numero n'existe pas");
getch();
textcolor(7);
clrscr();
gotoxy(6,35);printf("                     ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»              \n");
gotoxy(6,36);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ VOULEZ VOUS CHERCHER UNE AUTRE ÌÍÍÍÍÍÍÍÍÍÍÍÍ  \n");
gotoxy(6,37);printf("                     º          O  [    ]  N          º              \n");
gotoxy(6,38);printf("                     ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ             \n");


}

     fclose(a);
  flushall();

gotoxy(44,37);scanf("%c",&rep);
rep=toupper(rep);
}
while(rep!='N');
     }
/**********************fonction lister*********************/
void          listersoc()
    {
    int j;
    clrscr();
    a=fopen("c:\\sos.txt","r");
    if(a==NULL)
    {
     printf("le fichier inexistant");
     getch();
     exit(0);
     }
gotoxy(8,8); cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(8,9); cprintf("º     Sigle     º  Adresses  º     Tele     º   Categorie  º\n");
gotoxy(8,10);cprintf("ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍ͹\n");
gotoxy(8,11);cprintf("º               º            º              º              º\n");
gotoxy(8,12);cprintf("º               º            º              º              º\n");
gotoxy(8,13);cprintf("º               º            º              º              º\n");
gotoxy(8,14);cprintf("º               º            º              º              º\n");
gotoxy(8,15);cprintf("º               º            º              º              º\n");
gotoxy(8,16);cprintf("º               º            º              º              º\n");
gotoxy(8,17);cprintf("º               º            º              º              º\n");
gotoxy(8,18);cprintf("º               º            º              º              º\n");
gotoxy(8,19);cprintf("º               º            º              º              º\n");
gotoxy(8,20);cprintf("º               º            º              º              º\n");
gotoxy(8,21);cprintf("º               º            º              º              º\n");
gotoxy(8,22);cprintf("º               º            º              º              º\n");
gotoxy(8,23);cprintf("º               º            º              º              º\n");
gotoxy(8,24);cprintf("º               º            º              º              º\n");
gotoxy(8,25);cprintf("º               º            º              º              º\n");
gotoxy(8,26);cprintf("º               º            º              º              º\n");
gotoxy(8,27);cprintf("º               º            º              º              º\n");
gotoxy(8,28);cprintf("º               º            º              º              º\n");
gotoxy(8,29);cprintf("º               º            º              º              º\n");
gotoxy(8,30);cprintf("º               º            º              º              º\n");
gotoxy(8,31);cprintf("º               º            º              º              º\n");
gotoxy(8,32);cprintf("º               º            º              º              º\n");
gotoxy(8,33);cprintf("º               º            º              º              º\n");
gotoxy(8,34);cprintf("º               º            º              º              º\n");
gotoxy(8,35);cprintf("º               º            º              º              º\n");
gotoxy(8,36);cprintf("º               º            º              º              º\n");
gotoxy(8,37);cprintf("º               º            º              º              º\n");
gotoxy(8,38);cprintf("º               º            º              º              º\n");
gotoxy(8,39);cprintf("º               º            º              º              º\n");
gotoxy(8,40);cprintf("º               º            º              º              º\n");
gotoxy(8,41);cprintf("º               º            º              º              º\n");
gotoxy(8,42);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");

     j=0;
     while(!feof(a))
    {
fscanf(a,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,so.tele,so.fax
,so.patente,so.categorie);
   gotoxy(9,11+j);cprintf("%s",so.sigle);
   gotoxy(25,11+j);cprintf("%s",so.adresses);
   gotoxy(38,11+j);cprintf("%s",so.tele);
   gotoxy(53,11+j);cprintf("%s",so.categorie);
  j++;
    }
   getch();


   }
/***********************fonction supprimer*******************/
void          supprimersoc()
    {
    char r;
do
{

clrscr();
a=fopen("c:\\sos.txt","r");
     if(a==NULL)
     {
     printf("le fichier est absent\n");
     getch();
     exit(0);
     }
gotoxy(10,12);printf("                  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                 \n");
gotoxy(10,13);printf("                  º                              º                 \n");
gotoxy(10,14);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  ° SIGLE A SUPPRIMER?:....  °ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n");
gotoxy(10,15);printf("                  º                              º                 \n");
gotoxy(10,16);printf("                  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ                 \n");
gotoxy(52,14);
     scanf("%s",&sigle);

       bool=0;
     while(!feof(a))
     {
  fscanf(a,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,so.tele,so.fax
,so.patente,so.categorie);

  if(strcmpi(sigle,so.sigle)==0)
     {bool=1;
     break;
     }
     }
     if(bool==1)
     {
     clrscr();
gotoxy(13,6); printf("ÉÍËÍ»   ÉÍËÍ»                               ÉÍËÍ»   ÉÍËÍ»       \n");
gotoxy(13,7); printf("ÌÍÎ͹   ÌÍÎ͹                               ÌÍÎ͹   ÌÍÎ͹       \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ                               ÈÍÊͼÉÍ»ÈÍÊͼ       \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ»                               ÉÍËÍ»ÈÍ»ÉÍËÍ»       \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹                               ÌÍÎ͹ÈͼÌÍÎ͹       \n");
gotoxy(13,11);printf("ÈÍÊͼ   ÈÍÊͼ                               ÈÍÊͼ   ÈÍÊͼ       \n");
gotoxy(6,12);printf("                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                  \n");
gotoxy(6,13);printf("                   º                              º                  \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  °                        °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ           º                              º         ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ               º º\n");
gotoxy(6,17);printf("º º                                                               º º\n");
gotoxy(6,18);printf("º                        °     SOSIETE    °                         º\n");
gotoxy(6,19);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,20);printf("º    sigle           :                                              º\n");
gotoxy(6,21);printf("º                                                                   º\n");
gotoxy(6,22);printf("º    adresse         :                                              º\n");
gotoxy(6,23);printf("º                                                                   º\n");
gotoxy(6,24);printf("º    email           :                                              º\n");
gotoxy(6,25);printf("º                                                                   º\n");
gotoxy(6,26);printf("º    tel             :                                              º\n");
gotoxy(6,27);printf("º                                                                   º\n");
gotoxy(6,28);printf("º   fax              :                                              º\n");
gotoxy(6,29);printf("º                                                                   º\n");
gotoxy(6,30);printf("º   patente          :                                              º\n");
gotoxy(6,31);printf("º                                                                   º\n");
gotoxy(6,32);printf("º   categorie        :                                              º\n");
gotoxy(6,33);printf("º º                                                               º º\n");
gotoxy(6,34);printf("º º                                                               º º\n");
gotoxy(6,35);printf("º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º\n");
gotoxy(6,36);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(14+BLINK);
gotoxy(33,3);cprintf("Soci‚t‚");
textcolor(7);
gotoxy(29,20);printf("%s",&so.sigle);
gotoxy(29,22);printf("%s",&so.adresses);
gotoxy(29,24);printf("%s",&so.Email);
gotoxy(29,26);printf("%s",&so.tele);
gotoxy(29,28);printf("%s",&so.fax);
gotoxy(29,30);printf("%s",&so.patente);
gotoxy(29,32);printf("%s",&so.categorie);

flushall();
textcolor(4+BLINK);
gotoxy(20,47);cprintf("Voulez-vous supprimer?");
textcolor(7);
gotoxy(45,47);scanf("%c",&rep);
rep=toupper(rep);
if(rep=='O')


{
    f2=fopen("c:\\sos.txt","r");
    b=fopen("c:\\s.txt","w");


   while(!feof(f2))
   {
   flushall();
   fscanf(f2,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,so.tele,so.fax
,so.patente,so.sigle);

  if(strcmpi(sigle,so.sigle)!=0)

   fprintf(b,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,so.tele,so.fax
,so.patente,so.sigle);

}
fclose(f2);
fclose(b);
f2=fopen("c:\\sos.txt","w");
b=fopen("c:\\s.txt","r");



while(!feof(b))
   {
   flushall();
fscanf(b,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,
so.tele,so.fax,so.patente,so.categorie);


   fprintf(f2,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,so.tele,so.fax
,so.patente,so.categorie);

}
fclose(b);
fclose(f2);



}   }
     else
  {
   clrscr();
gotoxy(25,25);cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(25,26);cprintf("º                          º\n");
gotoxy(25,27);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(12+BLINK);;
gotoxy(28,26);cprintf("ce numero n'existe pas");
getch();

     }

flushall();clrscr();textbackground(5);
gotoxy(10,25);cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(10,26);cprintf("º Voulez-vous supprimer un autre sigle     :..............º\n");
gotoxy(10,27);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(14+BLINK);
gotoxy(50,26);cprintf("(O/N)");
textcolor(7);
gotoxy(56,26);scanf("%c",&r);
clrscr();textbackground(1);
r=toupper(r);
}
while(r!='N');
}
/*********************fonction modifier********************/
void          modifiersoc()
   {
    char r;
do
{

clrscr();
a=fopen("c:\\sos.txt","r");
     if(a==NULL)
     {
     printf("le fichier est absent\n");
     getch();
     exit(0);
     }
gotoxy(10,12);printf("                  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                 \n");
gotoxy(10,13);printf("                  º                              º                 \n");
gotoxy(10,14);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  ° SIGLE A MODIFIER ?:....  °ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n");
gotoxy(10,15);printf("                  º                              º                 \n");
gotoxy(10,16);printf("                  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ                 \n");
gotoxy(52,14);
     scanf("%s",&sigle);

       bool=0;
     while(!feof(a))
     {
  fscanf(a,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,so.tele,so.fax
,so.patente,so.categorie);

  if(strcmpi(sigle,so.sigle)==0)
     {bool=1;
     break;
     }
     }
     if(bool==1)
     {
     clrscr();
gotoxy(13,6); printf("ÉÍËÍ»   ÉÍËÍ»                               ÉÍËÍ»   ÉÍËÍ»       \n");
gotoxy(13,7); printf("ÌÍÎ͹   ÌÍÎ͹                               ÌÍÎ͹   ÌÍÎ͹       \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ                               ÈÍÊͼÉÍ»ÈÍÊͼ       \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ»                               ÉÍËÍ»ÈÍ»ÉÍËÍ»       \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹                               ÌÍÎ͹ÈͼÌÍÎ͹       \n");
gotoxy(13,11);printf("ÈÍÊͼ   ÈÍÊͼ                               ÈÍÊͼ   ÈÍÊͼ       \n");
gotoxy(6,12);printf("                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                  \n");
gotoxy(6,13);printf("                   º                              º                  \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  °                        °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ           º                              º         ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ               º º\n");
gotoxy(6,17);printf("º º                                                               º º\n");
gotoxy(6,18);printf("º                        °     SOSIETE    °                         º\n");
gotoxy(6,19);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,20);printf("º    sigle           :                                              º\n");
gotoxy(6,21);printf("º                                                                   º\n");
gotoxy(6,22);printf("º    adresse         :                                              º\n");
gotoxy(6,23);printf("º                                                                   º\n");
gotoxy(6,24);printf("º    email           :                                              º\n");
gotoxy(6,25);printf("º                                                                   º\n");
gotoxy(6,26);printf("º    tel             :                                              º\n");
gotoxy(6,27);printf("º                                                                   º\n");
gotoxy(6,28);printf("º   fax              :                                              º\n");
gotoxy(6,29);printf("º                                                                   º\n");
gotoxy(6,30);printf("º   patente          :                                              º\n");
gotoxy(6,31);printf("º                                                                   º\n");
gotoxy(6,32);printf("º   categorie        :                                              º\n");
gotoxy(6,33);printf("º º                                                               º º\n");
gotoxy(6,34);printf("º º                                                               º º\n");
gotoxy(6,35);printf("º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º\n");
gotoxy(6,36);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(14+BLINK);
gotoxy(33,3);cprintf("Soci‚t‚");
textcolor(7);
gotoxy(29,20);printf("%s",&so.sigle);
gotoxy(29,22);printf("%s",&so.adresses);
gotoxy(29,24);printf("%s",&so.Email);
gotoxy(29,26);printf("%s",&so.tele);
gotoxy(29,28);printf("%s",&so.fax);
gotoxy(29,30);printf("%s",&so.patente);
gotoxy(29,32);printf("%s",&so.categorie);
getch();
clrscr();
gotoxy(13,6); printf("ÉÍËÍ»   ÉÍËÍ»                               ÉÍËÍ»   ÉÍËÍ»       \n");
gotoxy(13,7); printf("ÌÍÎ͹   ÌÍÎ͹                               ÌÍÎ͹   ÌÍÎ͹       \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ                               ÈÍÊͼÉÍ»ÈÍÊͼ       \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ»                               ÉÍËÍ»ÈÍ»ÉÍËÍ»       \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹                               ÌÍÎ͹ÈͼÌÍÎ͹       \n");
gotoxy(13,11);printf("ÈÍÊͼ   ÈÍÊͼ                               ÈÍÊͼ   ÈÍÊͼ       \n");
gotoxy(6,12);printf("                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                  \n");
gotoxy(6,13);printf("                   º                              º                  \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  °                        °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ           º                              º         ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ               º º\n");
gotoxy(6,17);printf("º º                                                               º º\n");
gotoxy(6,18);printf("º                        °     SOSIETE    °                         º\n");
gotoxy(6,19);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,20);printf("º    sigle           :                                              º\n");
gotoxy(6,21);printf("º                                                                   º\n");
gotoxy(6,22);printf("º    adresse         :                                              º\n");
gotoxy(6,23);printf("º                                                                   º\n");
gotoxy(6,24);printf("º    email           :                                              º\n");
gotoxy(6,25);printf("º                                                                   º\n");
gotoxy(6,26);printf("º    tel             :                                              º\n");
gotoxy(6,27);printf("º                                                                   º\n");
gotoxy(6,28);printf("º   fax              :                                              º\n");
gotoxy(6,29);printf("º                                                                   º\n");
gotoxy(6,30);printf("º   patente          :                                              º\n");
gotoxy(6,31);printf("º                                                                   º\n");
gotoxy(6,32);printf("º   categorie        :                                              º\n");
gotoxy(6,33);printf("º º                                                               º º\n");
gotoxy(6,34);printf("º º                                                               º º\n");
gotoxy(6,35);printf("º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º\n");
gotoxy(6,36);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(14+BLINK);
gotoxy(33,3);cprintf("Soci‚t‚");
textcolor(7);
gotoxy(29,20);scanf("%s",siglem);
gotoxy(29,22);scanf("%s",adressesm);
gotoxy(29,24);scanf("%s",Emailm);
gotoxy(29,26);scanf("%s",telem);
gotoxy(29,28);scanf("%s",faxm);
gotoxy(29,30);scanf("%s",patentem);
gotoxy(29,32);scanf("%s",categoriem);

flushall();
textcolor(4+BLINK);
gotoxy(20,47);cprintf("Voulez-vous Modifier?");
textcolor(7);
gotoxy(45,47);scanf("%c",&rep);
rep=toupper(rep);
if(rep=='O')


{
    f2=fopen("c:\\sos.txt","r");
    b=fopen("c:\\s.txt","w");


   while(!feof(f2))
   {
   flushall();
   fscanf(f2,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,so.tele,so.fax
,so.patente,so.sigle);

  if(strcmpi(sigle,so.sigle)==0)
  fprintf(b,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",siglem,adressesm,Emailm,telem,faxm,
patentem,siglem);
    else

   fprintf(b,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,so.tele,so.fax
,so.patente,so.sigle);

}
fclose(f2);
fclose(b);
f2=fopen("c:\\sos.txt","w");
b=fopen("c:\\s.txt","r");



while(!feof(b))
   {
   flushall();
fscanf(b,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,
so.tele,so.fax,so.patente,so.categorie);


   fprintf(f2,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,so.tele,so.fax
,so.patente,so.categorie);

}
fclose(b);
fclose(f2);



}   }
     else
  {
   clrscr();
gotoxy(25,25);cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(25,26);cprintf("º                          º\n");
gotoxy(25,27);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(12+BLINK);;
gotoxy(28,26);cprintf("ce numero n'existe pas");
getch();

     }

flushall();clrscr();textbackground(5);
gotoxy(10,25);cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(10,26);cprintf("º Voulez-vous modifier un autre sigle     :..............º\n");
gotoxy(10,27);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(14+BLINK);
gotoxy(50,26);cprintf("(O/N)");
textcolor(7);
gotoxy(56,26);scanf("%c",&r);
clrscr();textbackground(1);
r=toupper(r);
}
while(r!='N');
}



/*********************programme principale*****************/
void         mainsoc()
   {do   {
       do{clrscr();
  menu(); //getch();
// menu();
  gotoxy(54,37);scanf ("%c",&choix);
      choix=toupper(choix);
  }while((choix=='A')&&(choix=='S')&&(choix=='l')&&(choix=='M')&&(choix=='R')
   &&(choix=='Q')) ;
   switch(choix)
   {case'A':{ajoutersoc();

    break;}
     case'S':{supprimersoc();
    break;
    }
     case'L':{listersoc();
    break;
    }
    case'M':{modifiersoc();
    break;
    }
    case'R':{recherchersoc();
    break;
    }
       }
       }while(choix!='Q');
}





/**********************fonction ajouter*********************/
void          ajouteraff()
    {
    FILE *s1,*s2;
    int ex1,ex2;
do
{
    clrscr();
    flushall();
    a=fopen("c:\\aff.txt","a+");
    if(a==NULL)
    {a=fopen("c:\\aff.txt","w");}
gotoxy(13,6); printf("ÉÍËÍ»   ÉÍËÍ»                               ÉÍËÍ»   ÉÍËÍ»       \n");
gotoxy(13,7); printf("ÌÍÎ͹   ÌÍÎ͹                               ÌÍÎ͹   ÌÍÎ͹       \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ                               ÈÍÊͼÉÍ»ÈÍÊͼ       \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ»                               ÉÍËÍ»ÈÍ»ÉÍËÍ»       \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹                               ÌÍÎ͹ÈͼÌÍÎ͹       \n");
gotoxy(13,11);printf("ÈÍÊͼ   ÈÍÊͼ                               ÈÍÊͼ   ÈÍÊͼ       \n");
gotoxy(6,12);printf("                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                  \n");
gotoxy(6,13);printf("                   º                              º                  \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  °                        °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ           º                              º         ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ               º º\n");
gotoxy(6,17);printf("º º                                                               º º\n");
gotoxy(6,18);printf("º                        °    AFFECTATION    °                      º\n");
gotoxy(6,19);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,20);printf("º    Num Affectation :                                              º\n");
gotoxy(6,21);printf("º                                                                   º\n");
gotoxy(6,22);printf("º    Date Affectation:                                              º\n");
gotoxy(6,23);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,24);printf("º    Num Inscr Stag  :                                              º\n");
gotoxy(6,25);printf("º                                                                   º\n");
gotoxy(6,26);printf("º    Nom stagiaire   :                                              º\n");
gotoxy(6,27);printf("º                                                                   º\n");
gotoxy(6,28);printf("º    Pr‚nom stag     :                                              º\n");
gotoxy(6,29);printf("º           ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ        º\n");
gotoxy(6,30);printf("º    Sigle Soci‚t‚   :                                              º\n");
gotoxy(6,31);printf("º                                                                   º\n");
gotoxy(6,32);printf("º    Cat‚gorie       :                                              º\n");
gotoxy(6,33);printf("º º                                                               º º\n");
gotoxy(6,34);printf("º º                                                               º º\n");
gotoxy(6,35);printf("º ÈÍÍÍÍÍ              ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»       ÍÍͼ º\n");
gotoxy(6,36);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ VOULEZ VOUS AJOUTER UNE AUTRE  ÌÍÍÍÍÍÍÍÍÍÍÍͼ\n");
gotoxy(6,37);printf("                      º          O  [    ]  N          º             \n");
gotoxy(6,38);printf("                      ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ     \n");
textcolor(7);
gotoxy(29,20);scanf("%s",&aff.numaf);

gotoxy(29,22);scanf("%s",&aff.dateaf);



l1:flushall();
gotoxy(29,24);scanf("%s",&aff.ninscription);
s1=fopen("c:\\stag.txt","r");

    ex1=0;
     while(!feof(s1))
     {flushall();

fscanf(s1,"%s\t%s\t%s\t%s\t%s\t%s\n",st.ninscription,st.nomst,st.Prenom,st.adresse,st.daten,st.filiere);

if(strcmpi(aff.ninscription,st.ninscription)==0)
     {ex1=1;
     break;
     }
     }
     if(ex1==1)
     {
gotoxy(29,26);printf("%s",st.nomst);
gotoxy(29,28);printf("%s",st.Prenom);
strcpy(aff.nomst,st.nomst);
strcpy(aff.Prenom,st.Prenom);

     }
     else
     {
     gotoxy(29,24);printf("CE Nø EST ABSENT");
     gotoxy(29,24);getch();
     gotoxy(29,24);printf("                ");
     goto l1;

     }



l2:flushall();
gotoxy(29,30);scanf("%s",&aff.sigle);
  s2=fopen("c:\\sos.txt","r");
ex2=0;
     while(!feof(s2))
     {
  fscanf(s2,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",so.sigle,so.adresses,so.Email,so.tele,so.fax
,so.patente,so.categorie);


  if(strcmpi(aff.sigle,so.sigle)==0)
     {ex2=1;
     break;
     }
     }
     if(ex2==1)
     {
     gotoxy(29,32);printf("%s",so.categorie);
     strcpy(aff.categorie,so.categorie);
     }
     else
     {
     gotoxy(29,30);printf("SIGLE ABSEBNT");
     gotoxy(29,30);getch();
     gotoxy(29,30);scanf("              ");
     goto l2;
     }


fprintf(a,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",aff.numaf,aff.dateaf,aff.ninscription,
     aff.nomst,aff.Prenom,aff.sigle,aff.categorie);


flushall();
gotoxy(44,37);scanf("%c",&rep);
rep=toupper(rep);
}
while(rep!='N');
}
//**********************fonction rechercher*****************/
void          rechercheraff()
{

do
{
clrscr();
    char sigle[20];
    a=fopen("c:\\aff.txt","r");
     if(a==NULL)
     {
     gotoxy(26,20);printf("fichier inexistant\n");
     getch();
     exit(1);
     }
gotoxy(10,12);printf("                  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                 \n");
gotoxy(10,13);printf("                  º                              º                 \n");
gotoxy(10,14);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  ° Nø A CHERCHER?.........  °ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n");
gotoxy(10,15);printf("                  º                              º                 \n");
gotoxy(10,16);printf("                  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ                 \n");
gotoxy(52,14);scanf("%s",&numaf);
     bool=0;
     while(!feof(a))
     {
fscanf(a,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",aff.numaf,aff.dateaf,aff.ninscription,
     aff.nomst,aff.Prenom,aff.sigle,aff.categorie);

  if(strcmpi(numaf,aff.numaf)==0)
     {bool=1;
     break;
     }
     }
     if(bool==1)
     {
     clrscr();
gotoxy(13,6); printf("ÉÍËÍ»   ÉÍËÍ»                               ÉÍËÍ»   ÉÍËÍ»       \n");
gotoxy(13,7); printf("ÌÍÎ͹   ÌÍÎ͹                               ÌÍÎ͹   ÌÍÎ͹       \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ                               ÈÍÊͼÉÍ»ÈÍÊͼ       \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ»                               ÉÍËÍ»ÈÍ»ÉÍËÍ»       \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹                               ÌÍÎ͹ÈͼÌÍÎ͹       \n");
gotoxy(13,11);printf("ÈÍÊͼ   ÈÍÊͼ                               ÈÍÊͼ   ÈÍÊͼ       \n");
gotoxy(6,12);printf("                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                  \n");
gotoxy(6,13);printf("                   º                              º                  \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  °                        °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ           º                              º         ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ               º º\n");
gotoxy(6,17);printf("º º                                                               º º\n");
gotoxy(6,18);printf("º                        °    AFFECTATION    °                      º\n");
gotoxy(6,19);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,20);printf("º    Num Affectation :                                              º\n");
gotoxy(6,21);printf("º                                                                   º\n");
gotoxy(6,22);printf("º    Date Affectation:                                              º\n");
gotoxy(6,23);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,24);printf("º    Num Inscr Stag  :                                              º\n");
gotoxy(6,25);printf("º                                                                   º\n");
gotoxy(6,26);printf("º    Nom stagiaire   :                                              º\n");
gotoxy(6,27);printf("º                                                                   º\n");
gotoxy(6,28);printf("º    Pr‚nom stag     :                                              º\n");
gotoxy(6,29);printf("º           ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ        º\n");
gotoxy(6,30);printf("º    Sigle Soci‚t‚   :                                              º\n");
gotoxy(6,31);printf("º                                                                   º\n");
gotoxy(6,32);printf("º    Cat‚gorie       :                                              º\n");
gotoxy(6,33);printf("º º                                                               º º\n");
gotoxy(6,34);printf("º º                                                               º º\n");
gotoxy(6,35);printf("º ÈÍÍÍÍÍ              ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»       ÍÍͼ º\n");
gotoxy(6,36);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ VOULEZ VOUS CHERCHE UNE AUTRE  ÌÍÍÍÍÍÍÍÍÍÍÍͼ\n");
gotoxy(6,37);printf("                      º          O  [    ]  N          º             \n");
gotoxy(6,38);printf("                      ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ     \n");
textcolor(7);
gotoxy(29,20);printf("%s",aff.numaf);
gotoxy(29,22);printf("%s",aff.dateaf);
gotoxy(29,24);printf("%s",aff.ninscription);
gotoxy(29,26);printf("%s",aff.nomst);
gotoxy(29,28);printf("%s",aff.Prenom);
gotoxy(29,30);printf("%s",aff.sigle);
gotoxy(29,32);printf("%s",aff.categorie);

}
     else
  {
   clrscr();
gotoxy(25,25);cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(25,26);cprintf("º                          º\n");
gotoxy(25,27);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(12+BLINK);;
gotoxy(28,26);cprintf("ce numero n'existe pas");
getch();
textcolor(7);
clrscr();
gotoxy(6,35);printf("                     ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»              \n");
gotoxy(6,36);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ VOULEZ VOUS CHERCHER UNE AUTRE ÌÍÍÍÍÍÍÍÍÍÍÍÍ  \n");
gotoxy(6,37);printf("                     º          O  [    ]  N          º              \n");
gotoxy(6,38);printf("                     ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ             \n");


}

     fclose(a);
  flushall();

gotoxy(44,37);scanf("%c",&rep);
rep=toupper(rep);
}
while(rep!='N');
     }
/**********************fonction lister*********************/
void          listeraff()
    {
    int j;
    clrscr();
    a=fopen("c:\\aff.txt","r");
    if(a==NULL)
    {
     printf("le fichier inexistant");
     getch();
     exit(0);
     }
gotoxy(8,8); cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(8,9); cprintf("º     Nø AFF    º    DATE    ºNøINSCRIPTION º     SIGLE    º\n");
gotoxy(8,10);cprintf("ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍ͹\n");
gotoxy(8,11);cprintf("º               º            º              º              º\n");
gotoxy(8,12);cprintf("º               º            º              º              º\n");
gotoxy(8,13);cprintf("º               º            º              º              º\n");
gotoxy(8,14);cprintf("º               º            º              º              º\n");
gotoxy(8,15);cprintf("º               º            º              º              º\n");
gotoxy(8,16);cprintf("º               º            º              º              º\n");
gotoxy(8,17);cprintf("º               º            º              º              º\n");
gotoxy(8,18);cprintf("º               º            º              º              º\n");
gotoxy(8,19);cprintf("º               º            º              º              º\n");
gotoxy(8,20);cprintf("º               º            º              º              º\n");
gotoxy(8,21);cprintf("º               º            º              º              º\n");
gotoxy(8,22);cprintf("º               º            º              º              º\n");
gotoxy(8,23);cprintf("º               º            º              º              º\n");
gotoxy(8,24);cprintf("º               º            º              º              º\n");
gotoxy(8,25);cprintf("º               º            º              º              º\n");
gotoxy(8,26);cprintf("º               º            º              º              º\n");
gotoxy(8,27);cprintf("º               º            º              º              º\n");
gotoxy(8,28);cprintf("º               º            º              º              º\n");
gotoxy(8,29);cprintf("º               º            º              º              º\n");
gotoxy(8,30);cprintf("º               º            º              º              º\n");
gotoxy(8,31);cprintf("º               º            º              º              º\n");
gotoxy(8,32);cprintf("º               º            º              º              º\n");
gotoxy(8,33);cprintf("º               º            º              º              º\n");
gotoxy(8,34);cprintf("º               º            º              º              º\n");
gotoxy(8,35);cprintf("º               º            º              º              º\n");
gotoxy(8,36);cprintf("º               º            º              º              º\n");
gotoxy(8,37);cprintf("º               º            º              º              º\n");
gotoxy(8,38);cprintf("º               º            º              º              º\n");
gotoxy(8,39);cprintf("º               º            º              º              º\n");
gotoxy(8,40);cprintf("º               º            º              º              º\n");
gotoxy(8,41);cprintf("º               º            º              º              º\n");
gotoxy(8,42);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");

     j=0;
     while(!feof(a))
    {
fscanf(a,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",aff.numaf,aff.dateaf,aff.ninscription,
     aff.nomst,aff.Prenom,aff.sigle,aff.categorie);
   gotoxy(9,11+j);cprintf("%s",aff.numaf);
   gotoxy(25,11+j);cprintf("%s",aff.dateaf);
   gotoxy(38,11+j);cprintf("%s",aff.ninscription);
   gotoxy(53,11+j);cprintf("%s",aff.sigle);
  j++;
    }
   getch();


   }
/***********************fonction supprimer*******************/
void          supprimeraff()
    {
    char r;
do
{

clrscr();
a=fopen("c:\\aff.txt","r");
     if(a==NULL)
     {
     printf("le fichier est absent\n");
     getch();
     exit(0);
     }
gotoxy(10,12);printf("                  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                 \n");
gotoxy(10,13);printf("                  º                              º                 \n");
gotoxy(10,14);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  ° Nø A SUPPRIMER?:.......  °ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n");
gotoxy(10,15);printf("                  º                              º                 \n");
gotoxy(10,16);printf("                  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ                 \n");
gotoxy(52,14);
     scanf("%s",&numaf);

       bool=0;
     while(!feof(a))
     {
fscanf(a,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",aff.numaf,aff.dateaf,aff.ninscription,
     aff.nomst,aff.Prenom,aff.sigle,aff.categorie);

  if(strcmpi(aff.numaf,numaf)==0)
     {bool=1;
     break;
     }
     }
     if(bool==1)
     {
     clrscr();
gotoxy(13,6); printf("ÉÍËÍ»   ÉÍËÍ»                               ÉÍËÍ»   ÉÍËÍ»       \n");
gotoxy(13,7); printf("ÌÍÎ͹   ÌÍÎ͹                               ÌÍÎ͹   ÌÍÎ͹       \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ                               ÈÍÊͼÉÍ»ÈÍÊͼ       \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ»                               ÉÍËÍ»ÈÍ»ÉÍËÍ»       \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹                               ÌÍÎ͹ÈͼÌÍÎ͹       \n");
gotoxy(13,11);printf("ÈÍÊͼ   ÈÍÊͼ                               ÈÍÊͼ   ÈÍÊͼ       \n");
gotoxy(6,12);printf("                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                  \n");
gotoxy(6,13);printf("                   º                              º                  \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  °                        °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ           º                              º         ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ               º º\n");
gotoxy(6,17);printf("º º                                                               º º\n");
gotoxy(6,18);printf("º                        °    AFFECTATION    °                      º\n");
gotoxy(6,19);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,20);printf("º    Num Affectation :                                              º\n");
gotoxy(6,21);printf("º                                                                   º\n");
gotoxy(6,22);printf("º    Date Affectation:                                              º\n");
gotoxy(6,23);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,24);printf("º    Num Inscr Stag  :                                              º\n");
gotoxy(6,25);printf("º                                                                   º\n");
gotoxy(6,26);printf("º    Nom stagiaire   :                                              º\n");
gotoxy(6,27);printf("º                                                                   º\n");
gotoxy(6,28);printf("º    Pr‚nom stag     :                                              º\n");
gotoxy(6,29);printf("º           ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ        º\n");
gotoxy(6,30);printf("º    Sigle Soci‚t‚   :                                              º\n");
gotoxy(6,31);printf("º                                                                   º\n");
gotoxy(6,32);printf("º    Cat‚gorie       :                                              º\n");
gotoxy(6,33);printf("º º                                                               º º\n");
gotoxy(6,34);printf("º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º\n");
gotoxy(6,35);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(7);
gotoxy(29,20);printf("%s",aff.numaf);
gotoxy(29,22);printf("%s",aff.dateaf);
gotoxy(29,24);printf("%s",aff.ninscription);
gotoxy(29,26);printf("%s",aff.nomst);
gotoxy(29,28);printf("%s",aff.Prenom);
gotoxy(29,30);printf("%s",aff.sigle);

flushall();
textcolor(4+BLINK);
gotoxy(20,47);cprintf("Voulez-vous supprimer?");
textcolor(7);
gotoxy(45,47);scanf("%c",&rep);
rep=toupper(rep);
if(rep=='O')


{
    f2=fopen("c:\\aff.txt","r");
    b=fopen("c:\\s.txt","w");


   while(!feof(f2))
   {
   flushall();
fscanf(f2,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",aff.numaf,aff.dateaf,aff.ninscription,
     aff.nomst,aff.Prenom,aff.sigle,aff.categorie);

  if(strcmpi(numaf,aff.numaf)!=0)

fprintf(b,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",aff.numaf,aff.dateaf,aff.ninscription,
     aff.nomst,aff.Prenom,aff.sigle,aff.categorie);

}
fclose(f2);
fclose(b);
f2=fopen("c:\\aff.txt","w");
b=fopen("c:\\s.txt","r");



while(!feof(b))
   {
   flushall();
  flushall();
fscanf(b,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",aff.numaf,aff.dateaf,aff.ninscription,
     aff.nomst,aff.Prenom,aff.sigle,aff.categorie);


fprintf(f2,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",aff.numaf,aff.dateaf,aff.ninscription,
     aff.nomst,aff.Prenom,aff.sigle,aff.categorie);
}
fclose(b);
fclose(f2);



}   }
     else
  {
   clrscr();
gotoxy(25,25);cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(25,26);cprintf("º                          º\n");
gotoxy(25,27);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(12+BLINK);;
gotoxy(28,26);cprintf("ce numero n'existe pas");
getch();

     }

flushall();clrscr();textbackground(5);
gotoxy(10,25);cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(10,26);cprintf("º Voulez-vous supprimer une autre          :..............º\n");
gotoxy(10,27);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(14+BLINK);
gotoxy(50,26);cprintf("(O/N)");
textcolor(7);
gotoxy(56,26);scanf("%c",&r);
clrscr();textbackground(1);
r=toupper(r);
}
while(r!='N');
}
/*********************fonction modifier********************/
void          modifieraff()
   {
    char r;
do
{

clrscr();
a=fopen("c:\\aff.txt","r");
     if(a==NULL)
     {
    gotoxy(26,20);printf("le fichier est absent\n");
     getch();
     exit(0);
     }
gotoxy(10,12);printf("                  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                 \n");
gotoxy(10,13);printf("                  º                              º                 \n");
gotoxy(10,14);printf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  ° Nø A MODIFIER:.........  °ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n");
gotoxy(10,15);printf("                  º                              º                 \n");
gotoxy(10,16);printf("                  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ                 \n");
gotoxy(52,14);
     scanf("%s",&numaf);

       bool=0;
     while(!feof(a))
     {
fscanf(a,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",aff.numaf,aff.dateaf,aff.ninscription,
     aff.nomst,aff.Prenom,aff.sigle,aff.categorie);

  if(strcmpi(aff.numaf,numaf)==0)
     {bool=1;
     break;
     }
     }
     if(bool==1)
     {
     clrscr();
gotoxy(13,6); printf("ÉÍËÍ»   ÉÍËÍ»                               ÉÍËÍ»   ÉÍËÍ»       \n");
gotoxy(13,7); printf("ÌÍÎ͹   ÌÍÎ͹                               ÌÍÎ͹   ÌÍÎ͹       \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ                               ÈÍÊͼÉÍ»ÈÍÊͼ       \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ»                               ÉÍËÍ»ÈÍ»ÉÍËÍ»       \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹                               ÌÍÎ͹ÈͼÌÍÎ͹       \n");
gotoxy(13,11);printf("ÈÍÊͼ   ÈÍÊͼ                               ÈÍÊͼ   ÈÍÊͼ       \n");
gotoxy(6,12);printf("                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                  \n");
gotoxy(6,13);printf("                   º                              º                  \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  °                        °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ           º                              º         ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ               º º\n");
gotoxy(6,17);printf("º º                                                               º º\n");
gotoxy(6,18);printf("º                        °    AFFECTATION    °                      º\n");
gotoxy(6,19);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,20);printf("º    Num Affectation :                                              º\n");
gotoxy(6,21);printf("º                                                                   º\n");
gotoxy(6,22);printf("º    Date Affectation:                                              º\n");
gotoxy(6,23);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,24);printf("º    Num Inscr Stag  :                                              º\n");
gotoxy(6,25);printf("º                                                                   º\n");
gotoxy(6,26);printf("º    Nom stagiaire   :                                              º\n");
gotoxy(6,27);printf("º                                                                   º\n");
gotoxy(6,28);printf("º    Pr‚nom stag     :                                              º\n");
gotoxy(6,29);printf("º           ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ        º\n");
gotoxy(6,30);printf("º    Sigle Soci‚t‚   :                                              º\n");
gotoxy(6,31);printf("º                                                                   º\n");
gotoxy(6,32);printf("º    Cat‚gorie       :                                              º\n");
gotoxy(6,33);printf("º º                                                               º º\n");
gotoxy(6,34);printf("º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º\n");
gotoxy(6,35);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(7);
gotoxy(29,20);printf("%s",aff.numaf);
gotoxy(29,22);printf("%s",aff.dateaf);
gotoxy(29,24);printf("%s",aff.ninscription);
gotoxy(29,26);printf("%s",aff.nomst);
gotoxy(29,28);printf("%s",aff.Prenom);
gotoxy(29,30);printf("%s",aff.sigle);
getch();
clrscr();
gotoxy(13,6); printf("ÉÍËÍ»   ÉÍËÍ»                               ÉÍËÍ»   ÉÍËÍ»       \n");
gotoxy(13,7); printf("ÌÍÎ͹   ÌÍÎ͹                               ÌÍÎ͹   ÌÍÎ͹       \n");
gotoxy(13,8); printf("ÈÍÊͼÉÍ»ÈÍÊͼ                               ÈÍÊͼÉÍ»ÈÍÊͼ       \n");
gotoxy(13,9); printf("ÉÍËÍ»ÈÍ»ÉÍËÍ»                               ÉÍËÍ»ÈÍ»ÉÍËÍ»       \n");
gotoxy(13,10);printf("ÌÍÎ͹ÈͼÌÍÎ͹                               ÌÍÎ͹ÈͼÌÍÎ͹       \n");
gotoxy(13,11);printf("ÈÍÊͼ   ÈÍÊͼ                               ÈÍÊͼ   ÈÍÊͼ       \n");
gotoxy(6,12);printf("                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»                  \n");
gotoxy(6,13);printf("                   º                              º                  \n");
gotoxy(6,14);printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹  °                        °  ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(6,15);printf("º ÉÍÍÍÍÍ           º                              º         ÍÍÍÍÍÍ» º\n");
gotoxy(6,16);printf("º º                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ               º º\n");
gotoxy(6,17);printf("º º                                                               º º\n");
gotoxy(6,18);printf("º                        °    AFFECTATION    °                      º\n");
gotoxy(6,19);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,20);printf("º    Num Affectation :                                              º\n");
gotoxy(6,21);printf("º                                                                   º\n");
gotoxy(6,22);printf("º    Date Affectation:                                              º\n");
gotoxy(6,23);printf("º            ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ       º\n");
gotoxy(6,24);printf("º    Num Inscr Stag  :                                              º\n");
gotoxy(6,25);printf("º                                                                   º\n");
gotoxy(6,26);printf("º    Nom stagiaire   :                                              º\n");
gotoxy(6,27);printf("º                                                                   º\n");
gotoxy(6,28);printf("º    Pr‚nom stag     :                                              º\n");
gotoxy(6,29);printf("º           ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ        º\n");
gotoxy(6,30);printf("º    Sigle Soci‚t‚   :                                              º\n");
gotoxy(6,31);printf("º                                                                   º\n");
gotoxy(6,32);printf("º    Cat‚gorie       :                                              º\n");
gotoxy(6,33);printf("º º                                                               º º\n");
gotoxy(6,34);printf("º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ º\n");
gotoxy(6,35);printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
gotoxy(29,20);scanf("%s",numafm);
gotoxy(29,22);scanf("%s",dateafm);
gotoxy(29,24);scanf("%s",ninscriptionm);
gotoxy(29,26);scanf("%s",nomstm);
gotoxy(29,28);scanf("%s",Prenomm);
gotoxy(29,30);scanf("%s",siglem);
gotoxy(29,32);scanf("%s",categoriem);
flushall();
textcolor(4+BLINK);
gotoxy(20,47);cprintf("Voulez-vous modifier?");
textcolor(7);
gotoxy(45,47);scanf("%c",&rep);
rep=toupper(rep);
if(rep=='O')


{
    f2=fopen("c:\\aff.txt","r");
    b=fopen("c:\\s.txt","w");


   while(!feof(f2))
   {
   flushall();
fscanf(f2,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",aff.numaf,aff.dateaf,aff.ninscription,
     aff.nomst,aff.Prenom,aff.sigle,aff.categorie);

  if(strcmpi(numaf,aff.numaf)==0)
  fprintf(b,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",numafm,dateafm,ninscriptionm,
     nomstm,Prenomm,siglem,categoriem);
  else

fprintf(b,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",aff.numaf,aff.dateaf,aff.ninscription,
     aff.nomst,aff.Prenom,aff.sigle,aff.categorie);

}
fclose(f2);
fclose(b);
f2=fopen("c:\\aff.txt","w");
b=fopen("c:\\s.txt","r");



while(!feof(b))
   {
   flushall();
  flushall();
fscanf(b,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",aff.numaf,aff.dateaf,aff.ninscription,
     aff.nomst,aff.Prenom,aff.sigle,aff.categorie);


fprintf(f2,"%s\t%s\t%s\t%s\t%s\t%s\t%s\n",aff.numaf,aff.dateaf,aff.ninscription,
     aff.nomst,aff.Prenom,aff.sigle,aff.categorie);
}
fclose(b);
fclose(f2);



}   }
     else
  {
   clrscr();
gotoxy(25,25);cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(25,26);cprintf("º                          º\n");
gotoxy(25,27);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(12+BLINK);;
gotoxy(28,26);cprintf("ce numero n'existe pas");
getch();

     }

flushall();clrscr();textbackground(5);
gotoxy(10,25);cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n");
gotoxy(10,26);cprintf("º Voulez-vous modifier une autre           :..............º\n");
gotoxy(10,27);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
textcolor(14+BLINK);
gotoxy(50,26);cprintf("(O/N)");
textcolor(7);
gotoxy(56,26);scanf("%c",&r);
clrscr();textbackground(1);
r=toupper(r);
}
while(r!='N');
}

/*********************programme principale*****************/
void         mainaff()
   {do   {
       do{clrscr();
  menu(); //getch();
// menu();
  gotoxy(54,37);scanf ("%c",&choix);
      choix=toupper(choix);
  }while((choix=='A')&&(choix=='S')&&(choix=='l')&&(choix=='M')&&(choix=='R')
   &&(choix=='Q')) ;
   switch(choix)
   {case'A':{ajouteraff();

    break;}
     case'S':{supprimeraff();
    break;
    }
     case'L':{listeraff();
    break;
    }
    case'M':{modifieraff();
    break;
    }
    case'R':{rechercheraff();
    break;
    }
       }
       }while(choix!='Q');
}

/*************************************************************************/
/*                              MENU PRINCIPAL                          */
/***********************************************************************/
void menup()
{

clrscr();
gotoxy(4,5) ;printf("  ÉÍÍÍÍ»                                                            ÉÍÍÍÍ»");
gotoxy(4 ,6);printf(" ɼ   ɼ                                                            È»   È»");
gotoxy(4 ,7);printf("ɼ    º                                                              º    È»");
gotoxy(4 ,8);printf("º     È»                                                            É¼     º");
gotoxy(4 ,9);printf("º      ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ      º");
gotoxy(4,10);printf("º                                                                          º");
gotoxy(4,11);printf("º                                                                          º");
gotoxy(4,12);printf("º                                                                          º");
gotoxy(4,13);printf("º     ÉÍÍÍÍÍÍÍÍÍÍÍ»         ÉÍÍÍÍÍÍÍÍÍÍÍ»         ÉÍÍÍÍÍÍÍÍÍÍÍ»            º");
gotoxy(4,14);printf("º    É¼           È»       ɼ           È»       ɼ           È»           º");
gotoxy(4,15);printf("º   ɼ             È»     ɼ             È»     ɼ             È»          º");
gotoxy(4,16);printf("º   º [S]® Stagiaireº     º[C]® Soci‚t‚   º     º[A]®Affectationº          º");
gotoxy(4,17);printf("º   È»             ɼ     È»             ɼ     È»             ɼ          º");
gotoxy(4,18);printf("º    È»           ɼ       È»           ɼ       È»           ɼ           º");
gotoxy(4,19);printf("º     ÈÍÍÍÍÍÍÍÍÍÍͼ         ÈÍÍÍÍÍÍÍÍÍÍͼ         ÈÍÍÍÍÍÍÍÍÍÍͼ            º");
gotoxy(4,20);printf("º                                                                          º");
gotoxy(4,21);printf("º                                                                          º");
gotoxy(4,22);printf("º                                                                          º");
gotoxy(4,23);printf("º                                                                          º");
gotoxy(4,24);printf("º                                                                          º");
gotoxy(4,25);printf("º                                                                          º");
gotoxy(4,26);printf("º                                                                          º");
gotoxy(4,27);printf("º                           ÉÍÍÍÍÍÍÍÍÍÍÍ»                                  º");
gotoxy(4,28);printf("º                          É¼           È»                                 º");
gotoxy(4,29);printf("º                         ɼ             È»                                º");
gotoxy(4,30);printf("º                         º[Q]® Quitter   º                                º");
gotoxy(4,31);printf("º                         È»             ɼ                                º");
gotoxy(4,32);printf("º                          È»           ɼ                                 º");
gotoxy(4,33);printf("º                           ÈÍÍÍÍÍÍÍÍÍÍͼ                                  º");
gotoxy(4,34);printf("º                                                                          º");
gotoxy(4,35);printf("º   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»       º");
gotoxy(4,36);printf("º  É¼                                                              È»      º");
gotoxy(4,37);printf("º  º                  ®® TAPEZ VOTRE CHOIX S.V.P [ ] ¯¯             º      º");
gotoxy(4,38);printf("º  È»                                                              É¼      º");
gotoxy(4,39);printf("º   ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ       º");
gotoxy(4,40);printf("º                                                                          º");
gotoxy(4,41);printf("È»                                                                        É¼");
gotoxy(4,42);printf(" È»                                                                      É¼");
gotoxy(4,43);printf("  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ");
textcolor(15+BLINK);
gotoxy(25,23);cprintf("BIENVENUE DANS VOTRE APPLICATION");
textcolor(7);

}
/*************************************************************************/
/*                              PROGRAMME RINCIPAL                      */
/***********************************************************************/
void         main()

   {
textbackground(1);
clrscr();
gotoxy(10,10);printf("²²²²²²²  ²²²²²²²² ²²²²²² ²²²²²²²² ²²²²²²²² ²²²²²²² ²²²²  ²²  \n");
gotoxy(10,11);printf("²²       ²²       ²²        ²²       ²²    ²²   ²² ²² ²² ²² \n");
gotoxy(10,12);printf("²² ²²²²² ²²²²²²²² ²²²²²²    ²²       ²²    ²²   ²² ²²  ²²²² \n");
gotoxy(10,13);printf("²²    ²² ²²           ²²    ²²       ²²    ²²   ²² ²²    ²² \n");
gotoxy(10,14);printf("²²²²²²²² ²²²²²²²² ²²²²²²  ²²²²²²  ²²²²²²²² ²²²²²²² ²²    ²² \n");
gotoxy(10,15);printf("   \n");
gotoxy(10,20);printf("   \n");
gotoxy(5,21);printf("²²²²²²² ²²²²²²²² ²²²²²²² ²²²²²²   ²²²²²² ²²²²²²² ²²²²²² ²²²²²²² ²²²²²²² \n");
gotoxy(5,22);printf("²²         ²²    ²²   ²² ²²         ²²   ²²   ²²   ²²   ²²      ²²   ²² \n");
gotoxy(5,23);printf("²²²²²²²    ²²    ²²²²²²² ²²  ²²²²   ²²   ²²²²²²²   ²²   ²²²²²²² ²²²²²²² \n");
gotoxy(5,24);printf("     ²²    ²²    ²²   ²² ²²    ²²   ²²   ²²   ²²   ²²   ²²      ²² ²²   \n");
gotoxy(5,25);printf("²²²²²²²   ²²²²   ²²   ²² ²²²²²²²² ²²²²²² ²²   ²² ²²²²²² ²²²²²²² ²²  ²² \n");
  getch();
  clrscr();
  flushall();m();_AX=3;geninterrupt(0x10);textmode(64);

   {
   char ch;
   do   {
       do{
   clrscr();
  menup();

  gotoxy(54,37);scanf ("%c",&ch);
      ch=toupper(ch);
  }while((ch=='C')&&(ch=='S')&&(ch=='A')&&(ch=='Q')) ;
   switch(ch)
   {

     case'A':{mainaff();
    break;}
     case'S':{mainstg();
    break;
    }
     case'C':{mainsoc();
    break;
    }

       }
       }while(ch!='Q');

}}

Commentaire de BruNews le 16/02/2007 13:27:30 administrateur CS

Je salue tout ce travail.
Il est malheureusement à noter que les écoles qui font perdre autant de temps aux élèves sur des trucs aussi obsolètes depuis si longtemps ne sont que des fabriques à futurs chomeurs.
Ce n'est assurément pas ta faute mais pense à étudier des trucs un peu plus d'actualité au dehors de l'école.
Bonne continuation.

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

probanilitée de main au blackjack [ par bast79 ] Salut je suis un nouvel etudiant en prog !Mon prof nous a donner un travaille et je suis un peu bloquer. j'explique je doit retourner la probabilitée


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,593 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales