1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
   | #include <iostream.h>
int const taillemax=100;
int i;
// structure
struct client
{
	int num;
	char vcot;
	float budget;
} ;
// liste des sous blocs 
void remplit ( client t[taillemax] , int &c , int &p);
void affiche ( client t[taillemax] , int &c , int &p );
// bloc principal 
int main()
{
	int inutile,compte,passe ;
	client tab[taillemax];
	remplit ( tab , compte , passe );
	affiche ( tab , compte , passe );
	cin>>inutile;
	return 0;
}
// sous blocs
void remplit ( client t[taillemax] , int &c , int &p) 
{
    cout<<"Taper 0 pour le numeros client quand il n y plus aucun client a saisir .";
	cout<<" \n";
	cout<<"------------------------------------------------------------";
	cout<<" \n";
	p=1;
	
	
    do
	{
        for(i=0;i<taillemax;i++)
	    {           
        cout<<"fiche client numeros : "<<p;
		cout<<" \n";
		cout<<"numeros du client : ";
		cin>>t[i].num;
		cout<<" \n";
		if (t[i].num!=0)
        {
        cout<<"vetement en coton majoritaire ? o pour oui , n pour non : ";
        cin>>t[i].vcot;
        cout<<" \n";
		
	    cout<<"budget du client : ";
	    cin>>t[i].budget;
	    cout<<" \n";
	
	    p=p+1;
        }
        else
        {
           [.......................]
        }
        }
    }
	while (t[i].num!=0);
    
	cout<<"Il n y a plus de client a saisir ";
	cout<<" \n";
}
void affiche ( client t[taillemax] , int &c , int &p )
{
     for(i=0;i<p-1;i++)
     {
        cout<<"client numeros : "<<t[i].num<<" ; vetement en coton : "<<t[i].vcot<<" ; budget client : "<<t[i].budget<<" euros ";
        cout<<" \n";
     }
     
     cout<<"Il y a au total "<<p-1<<" clients ";
} | 
Partager