Advertisement
Blackboul

PJ4 final

May 26th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 60.28 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #define TAILLE_MAX 150
  5.  
  6. typedef struct Motherboard{
  7.     char marque[TAILLE_MAX];
  8.     char modele[TAILLE_MAX];
  9.     char socket_proc[TAILLE_MAX];
  10.     char nbr_socket[TAILLE_MAX];
  11.     char nbr_ram[TAILLE_MAX];
  12.     char ver_ram[TAILLE_MAX];
  13.     char nbr_pci[TAILLE_MAX];
  14.     char nbr_ide[TAILLE_MAX];
  15.     char nbr_sata[TAILLE_MAX];
  16.     char nbr_usb[TAILLE_MAX];
  17.     char nbr_vga[TAILLE_MAX];
  18.     char nbr_dvi[TAILLE_MAX];
  19.     char nbr_reseau[TAILLE_MAX];
  20.     char format[TAILLE_MAX];
  21.     char usp[TAILLE_MAX];
  22.     char fiab[TAILLE_MAX];
  23.     char restrict[TAILLE_MAX];
  24.     char prix[TAILLE_MAX];
  25.     char conso_elec[TAILLE_MAX];
  26.     char overclock[TAILLE_MAX];
  27. }Motherboard;
  28.  
  29. typedef struct Graphics{
  30.  
  31.     char marque[TAILLE_MAX];//Marque
  32.     char modele[TAILLE_MAX];//Modèle
  33.     char nbr_vga[TAILLE_MAX];//Nombre de ports VGA
  34.     char nbr_dvi[TAILLE_MAX];//Nombre de ports DVI
  35.     char nbr_hdmi[TAILLE_MAX];//Nombre de ports HDMI
  36.     char nbr_minidp[TAILLE_MAX];//Nombre de ports MINIDP
  37.     char usp[TAILLE_MAX];//Unique Selling Points
  38.     char fiab[TAILLE_MAX];//Taux de fiabilité ( % de matériel vendu n'ayant pas montré de défaut)
  39.     char restrict[TAILLE_MAX];//Restrictions d'usage
  40.     char prix[TAILLE_MAX];//Prix
  41.     char perf[TAILLE_MAX];//Indice de performance
  42.     char conso_elec[TAILLE_MAX];//Consommation electrique
  43.     char overclock[TAILLE_MAX];//Coefficient d'overclocking (impacte les performances et la consommation)
  44. }Graphics;
  45.  
  46. typedef struct Hdd{
  47.     char marque[TAILLE_MAX];//Marque
  48.     char modele[TAILLE_MAX];//Modèle
  49.     char capa[TAILLE_MAX];//Espace disque (en Go)
  50.     char port[TAILLE_MAX];//Type de port
  51.     char usp[TAILLE_MAX];//Unique Selling Points
  52.     char fiab[TAILLE_MAX];//Taux de fiabilité ( % de matériel vendu n'ayant pas montré de défaut)
  53.     char restrict[TAILLE_MAX];//Restrictions d'usage
  54.     char prix[TAILLE_MAX];//Prix
  55.     char perf[TAILLE_MAX];//Indice de performance
  56.     char conso_elec[TAILLE_MAX];//Consommation electrique
  57. }Hdd;
  58.  
  59. typedef struct processeur{
  60.  
  61.     char marque[TAILLE_MAX];
  62.     char modele[TAILLE_MAX];
  63.     char socket[TAILLE_MAX];
  64.     char frequence[TAILLE_MAX];
  65.     char restriction[TAILLE_MAX];
  66.     char uniqueSellingPoint[TAILLE_MAX];
  67.     char nbemplacementRam[TAILLE_MAX];
  68.     char fiab[TAILLE_MAX];
  69.     char prix[TAILLE_MAX];
  70.     char indiceDePerf[TAILLE_MAX];
  71.     char consoElec[TAILLE_MAX];
  72.     char coefOverclock[TAILLE_MAX];
  73. }processeur;
  74.  
  75. typedef struct caracEcran{
  76.  
  77.     char marque[TAILLE_MAX];
  78.     char modele[TAILLE_MAX];
  79.     char taille[TAILLE_MAX];
  80.     char resolMax[TAILLE_MAX];
  81.     char typePort[TAILLE_MAX];
  82.     char uniqueSellingPoint[TAILLE_MAX];
  83.     char fiab[TAILLE_MAX];
  84.     char restriction[TAILLE_MAX];
  85.     char prix[TAILLE_MAX];
  86.     char indiceDePerf[TAILLE_MAX];
  87.     char consoElec[TAILLE_MAX];
  88. }caracEcran;
  89.  
  90. typedef struct Ram{
  91.  
  92.     char marque[TAILLE_MAX];
  93.     char modele[TAILLE_MAX];
  94.     char ver_ram[TAILLE_MAX];
  95.     char freq[TAILLE_MAX];
  96.     char ram_mod[TAILLE_MAX];
  97.     char fiab[TAILLE_MAX];
  98.     char restrict[TAILLE_MAX];
  99.     char prix[TAILLE_MAX];
  100.     char perform[TAILLE_MAX];
  101.     char cons_elec[TAILLE_MAX];
  102.     char overclock[TAILLE_MAX];
  103. }Ram;
  104.  
  105. typedef struct Soft{
  106.  
  107.     char soft[TAILLE_MAX];//Nom du logiciel
  108.     char ram[TAILLE_MAX];//RAM nécessaire
  109.     char rom[TAILLE_MAX];//Espace disque nécessaire
  110.     char puis_graph[TAILLE_MAX];//Puissance graphique nécessaire (X = aucun pré-requis)
  111.     char puis_proc[TAILLE_MAX];//Puissance processeur nécessaire
  112.     char usp[TAILLE_MAX];//Unique Selling Points nécessaires (X = aucun pré-requis)
  113. }Soft;
  114.  
  115. char** str_split(char* str, char delim){
  116.     // Define a function to do more than strtok
  117.     // str_split will return an array of all delimited string
  118.     char** ret;
  119.     int retLen;
  120.     char* c;
  121.  
  122.     if ((str == NULL ) || (delim == '\0'))
  123.     {
  124.         /* Either of those will cause problems */
  125.         ret = NULL;
  126.         retLen = -1;
  127.     }
  128.     else
  129.     {
  130.         retLen = 0;
  131.         c = str;
  132.  
  133.         /* Pre-calculate number of elements */
  134.         do
  135.         {
  136.             if (*c == delim)
  137.                 retLen++;
  138.  
  139.             c++;
  140.         } while (*c != '\0');
  141.  
  142.         ret = malloc((retLen + 1) * sizeof(*ret));
  143.         ret[retLen] = NULL;
  144.  
  145.         c = str;
  146.         retLen = 1;
  147.         ret[0] = str;
  148.  
  149.         do
  150.         {
  151.             if (*c == delim)
  152.             {
  153.                 ret[retLen++] = &c[1];
  154.                 *c = '\0';
  155.             }
  156.  
  157.             c++;
  158.         } while ( *c != '\0' );
  159.     }
  160.     return ret;
  161. }
  162.  
  163. void ouverture_motherboard(Motherboard motherboard_array[10]){
  164.     FILE* fichier = NULL;
  165.     char caractere[TAILLE_MAX];
  166.  
  167.     fichier = fopen("MOTHERBOARD.csv", "r");
  168.     if(fichier != NULL)
  169.     {
  170.     }
  171.     else
  172.     {
  173.         printf("impossible d'ouvrir le fichier");
  174.     }
  175.  
  176.     // Define our motherboard array to store all lines in CSV file
  177.  
  178.     int cpt = 0;
  179.     // get the whole line for each
  180.     while(fgets(caractere, TAILLE_MAX, fichier) != NULL)
  181.     {
  182.         // Get all the strings delimited by a ';'
  183.         char ** array = str_split(caractere, ';');
  184.  
  185.         // Define a new structure
  186.         Motherboard motherboard;
  187.  
  188.         // copy the content of each properties in the structure
  189.         strcpy(motherboard.marque, array[0]);
  190.         strcpy(motherboard.modele, array[1]);
  191.         strcpy(motherboard.socket_proc, array[2]);
  192.         strcpy(motherboard.nbr_socket, array[3]);
  193.         strcpy(motherboard.nbr_ram, array[4]);
  194.         strcpy(motherboard.ver_ram, array[5]);
  195.         strcpy(motherboard.nbr_pci, array[10]);
  196.         strcpy(motherboard.nbr_ide, array[7]);
  197.         strcpy(motherboard.nbr_sata, array[8]);
  198.         strcpy(motherboard.nbr_usb, array[9]);
  199.         strcpy(motherboard.nbr_vga, array[10]);
  200.         strcpy(motherboard.nbr_dvi, array[11]);
  201.         strcpy(motherboard.nbr_reseau, array[12]);
  202.         strcpy(motherboard.format, array[13]);
  203.         strcpy(motherboard.usp, array[14]);
  204.         strcpy(motherboard.fiab, array[15]);
  205.         strcpy(motherboard.restrict, array[16]);
  206.         strcpy(motherboard.prix, array[17]);
  207.         strcpy(motherboard.conso_elec, array[18]);
  208.         strcpy(motherboard.overclock, array[19]);
  209.  
  210.         // add this structure in the array defined previousment
  211.         motherboard_array[cpt++] = motherboard;
  212.     }
  213.     fclose(fichier);
  214. }
  215.  
  216. void ouverture_graphics(Graphics graphics_array[6]){
  217.     FILE* fichier = NULL;
  218.     char caractere[TAILLE_MAX];
  219.  
  220.     fichier = fopen("GRAPHICS.csv", "r");
  221.     if(fichier != NULL)
  222.     {
  223.     }
  224.     else
  225.     {
  226.         printf("impossible d'ouvrir le fichier");
  227.     }
  228.  
  229.     // Define our graphics array to store all lines in CSV file
  230.  
  231.     int cpt = 0;
  232.     // get the whole line for each
  233.     while(fgets(caractere, TAILLE_MAX, fichier) != NULL)
  234.     {
  235.         // Get all the strings delimited by a ';'
  236.         char ** array = str_split(caractere, ';');
  237.  
  238.         // Define a new structure
  239.         Graphics graphics;
  240.  
  241.         // copy the content of each properties in the structure
  242.         strcpy(graphics.marque, array[0]);
  243.         strcpy(graphics.modele, array[1]);
  244.         strcpy(graphics.nbr_vga, array[2]);
  245.         strcpy(graphics.nbr_dvi, array[3]);
  246.         strcpy(graphics.nbr_hdmi, array[4]);
  247.         strcpy(graphics.nbr_minidp, array[5]);
  248.         strcpy(graphics.usp, array[6]);
  249.         strcpy(graphics.fiab, array[7]);
  250.         strcpy(graphics.restrict, array[8]);
  251.         strcpy(graphics.prix, array[9]);
  252.         strcpy(graphics.perf, array[10]);
  253.         strcpy(graphics.conso_elec, array[11]);
  254.         strcpy(graphics.overclock, array[12]);
  255.  
  256.         // add this structure in the array defined previousment
  257.         graphics_array[cpt++] = graphics;
  258.     }
  259.     fclose(fichier);
  260. }
  261.  
  262. void ouverture_hdd(Hdd hdd_array[9]){
  263.     FILE* fichier = NULL;
  264.     char caractere[TAILLE_MAX];
  265.  
  266.     fichier = fopen("HDD.csv", "r");
  267.     if(fichier != NULL)
  268.     {
  269.     }
  270.     else
  271.     {
  272.         printf("impossible d'ouvrir le fichier");
  273.     }
  274.  
  275.     // Define our hdd array to store all lines in CSV file
  276.  
  277.     int cpt = 0;
  278.     // get the whole line for each
  279.     while(fgets(caractere, TAILLE_MAX, fichier) != NULL)
  280.     {
  281.         // Get all the strings delimited by a ';'
  282.         char ** array = str_split(caractere, ';');
  283.  
  284.         // Define a new structure
  285.         Hdd hdd;
  286.  
  287.         // copy the content of each properties in the structure
  288.         strcpy(hdd.marque, array[0]);
  289.         strcpy(hdd.modele, array[1]);
  290.         strcpy(hdd.capa, array[2]);
  291.         strcpy(hdd.port, array[3]);
  292.         strcpy(hdd.usp, array[4]);
  293.         strcpy(hdd.fiab, array[5]);
  294.         strcpy(hdd.restrict, array[6]);
  295.         strcpy(hdd.prix, array[7]);
  296.         strcpy(hdd.perf, array[8]);
  297.         strcpy(hdd.conso_elec, array[9]);
  298.  
  299.         // add this structure in the array defined previousment
  300.         hdd_array[cpt++] = hdd;
  301.     }
  302.  
  303.     fclose(fichier);
  304. }
  305.  
  306. void ouverture_proco(processeur proco_array[11]){
  307.     FILE* fichier = NULL;
  308.     char caractere[TAILLE_MAX];
  309.  
  310.     fichier = fopen("PROCO.csv", "r");
  311.     if(fichier != NULL)
  312.     {
  313.     }
  314.     else
  315.     {
  316.         printf("impossible d'ouvrir le fichier");
  317.     }
  318.  
  319.     // Define our proco array to store all lines in CSV file
  320.  
  321.  
  322.     int cpt = 0;
  323.     // get the whole line for each
  324.     while(fgets(caractere, TAILLE_MAX, fichier) != NULL)
  325.     {
  326.         // Get all the strings delimited by a ';'
  327.         char ** array = str_split(caractere, ';');
  328.  
  329.         // Define a new structure
  330.         processeur proco;
  331.  
  332.         // copy the content of each properties in the structure
  333.         strcpy(proco.marque, array[0]);
  334.         strcpy(proco.modele, array[1]);
  335.         strcpy(proco.socket, array[2]);
  336.         strcpy(proco.frequence, array[3]);
  337.         strcpy(proco.nbemplacementRam, array[4]);
  338.         strcpy(proco.uniqueSellingPoint, array[5]);
  339.         strcpy(proco.fiab, array[6]);
  340.         strcpy(proco.restriction, array[7]);
  341.         strcpy(proco.prix, array[8]);
  342.         strcpy(proco.indiceDePerf, array[9]);
  343.         strcpy(proco.consoElec, array[10]);
  344.         strcpy(proco.coefOverclock, array[11]);
  345.  
  346.         // add this structure in the array defined previousment
  347.         proco_array[cpt++] = proco;
  348.     }
  349.     fclose(fichier);
  350. }
  351.  
  352. void ouverture_Ecran(caracEcran ecran_array[9]){
  353.     FILE* fichier = NULL;
  354.     char caractere[TAILLE_MAX];
  355.  
  356.     fichier = fopen("ECRAN.csv", "r");
  357.     if(fichier != NULL)
  358.     {
  359.     }
  360.     else
  361.     {
  362.         printf("impossible d'ouvrir le fichier");
  363.     }
  364.  
  365.     // Define our proco array to store all lines in CSV file
  366.  
  367.     int cpt = 0;
  368.     // get the whole line for each
  369.     while(fgets(caractere, TAILLE_MAX, fichier) != NULL)
  370.     {
  371.         // Get all the strings delimited by a ';'
  372.         char ** array = str_split(caractere, ';');
  373.  
  374.         // Define a new structure
  375.         caracEcran ecran;
  376.  
  377.         // copy the content of each properties in the structure
  378.         strcpy(ecran.marque, array[0]);
  379.         strcpy(ecran.modele, array[1]);
  380.         strcpy(ecran.taille, array[2]);
  381.         strcpy(ecran.resolMax, array[3]);
  382.         strcpy(ecran.typePort, array[4]);
  383.         strcpy(ecran.uniqueSellingPoint, array[5]);
  384.         strcpy(ecran.fiab, array[6]);
  385.         strcpy(ecran.restriction, array[7]);
  386.         strcpy(ecran.prix, array[8]);
  387.         strcpy(ecran.indiceDePerf, array[9]);
  388.         strcpy(ecran.consoElec, array[10]);
  389.  
  390.  
  391.         // add this structure in the array defined previousment
  392.         ecran_array[cpt++] = ecran;
  393.     }
  394.  
  395.     fclose(fichier);
  396. }
  397.  
  398. void ouverture_ram(Ram ram_array[18]){
  399.     FILE* fichier = NULL;
  400.     char caractere[TAILLE_MAX];
  401.  
  402.     fichier = fopen("RAM.csv", "r");
  403.     if(fichier != NULL)
  404.     {
  405.     }
  406.     else
  407.     {
  408.         printf("impossible d'ouvrir le fichier");
  409.     }
  410.  
  411.     // Define our ram array to store all lines in CSV file
  412.  
  413.     int cpt = 0;
  414.     // get the whole line for each
  415.     while(fgets(caractere, TAILLE_MAX, fichier) != NULL)
  416.     {
  417.         // Get all the strings delimited by a ';'
  418.         char ** array = str_split(caractere, ';');
  419.  
  420.         // Define a new structure
  421.         Ram ram;
  422.  
  423.         // copy the content of each properties in the structure
  424.         strcpy(ram.marque, array[0]);
  425.         strcpy(ram.modele, array[1]);
  426.         strcpy(ram.ver_ram, array[2]);
  427.         strcpy(ram.freq, array[3]);
  428.         strcpy(ram.ram_mod, array[4]);
  429.         strcpy(ram.fiab, array[5]);
  430.         strcpy(ram.restrict, array[6]);
  431.         strcpy(ram.prix, array[7]);
  432.         strcpy(ram.perform, array[8]);
  433.         strcpy(ram.cons_elec, array[9]);
  434.         strcpy(ram.overclock, array[10]);
  435.  
  436.         // add this structure in the array defined previousment
  437.         ram_array[cpt++] = ram;
  438.     }
  439.  
  440.     fclose(fichier);
  441. }
  442.  
  443. void ouverture_soft(Soft soft_array[6]){
  444.     FILE* fichier = NULL;
  445.     char caractere[TAILLE_MAX];
  446.  
  447.     fichier = fopen("SOFTS.csv", "r");
  448.     if(fichier != NULL)
  449.     {
  450.     }
  451.     else
  452.     {
  453.         printf("impossible d'ouvrir le fichier");
  454.     }
  455.  
  456.     // Define our soft array to store all lines in CSV file
  457.  
  458.     int cpt = 0;
  459.     // get the whole line for each
  460.     while(fgets(caractere, TAILLE_MAX, fichier) != NULL)
  461.     {
  462.         // Get all the strings delimited by a ';'
  463.         char ** array = str_split(caractere, ';');
  464.  
  465.         // Define a new structure
  466.         Soft soft;
  467.  
  468.         // copy the content of each properties in the structure
  469.         strcpy(soft.soft, array[0]);
  470.         strcpy(soft.ram, array[1]);
  471.         strcpy(soft.rom, array[2]);
  472.         strcpy(soft.puis_graph, array[3]);
  473.         strcpy(soft.puis_proc, array[4]);
  474.         strcpy(soft.usp, array[5]);
  475.         // add this structure in the array defined previousment
  476.         soft_array[cpt++] = soft;
  477.     }
  478.  
  479.     fclose(fichier);
  480. }
  481.  
  482. void affichage_ram(){
  483.     printf("1: Marque\n");
  484.     printf("2: Modele\n");
  485.     printf("3: Version de la RAM\n");
  486.     printf("4: Frequence\n");
  487.     printf("5: Quantite par module\n");
  488.     printf("6: Taux de fiabilite du materiel\n");
  489.     printf("7: Prix\n");
  490.     printf("8: Indice de performance\n");
  491.     printf("9: Consommation electrique\n");
  492.     printf("10: Coefficient d'overclocking\n\n");
  493.     printf("0: Quitter la selection\n\n");
  494. }
  495.  
  496. void affichage_graphics(){
  497.     printf("1: Marque\n");
  498.     printf("2: Modele\n");
  499.     printf("3: Nombre de ports VGA\n");
  500.     printf("4: Nombre de ports DVI\n");
  501.     printf("5: Nombre de ports HDMI\n");
  502.     printf("6: Nombre de ports MINIDP\n");
  503.     printf("7: Unique Selling Points\n");
  504.     printf("8: Taux de fiabilite\n");
  505.     printf("9: Restrictions d'usage\n");
  506.     printf("10: Prix\n");
  507.     printf("11: Indice de performance\n");
  508.     printf("12: Consommation electrique\n");
  509.     printf("13: Coefficient d'overclocking\n\n");
  510.     printf("0: Quitter la selection\n\n");
  511. }
  512.  
  513. void affichage_motherboard(){
  514.     printf("1: Marque\n");
  515.     printf("2: Modele\n");
  516.     printf("3: Type de socket processeur\n");
  517.     printf("4: Nombre de socket\n");
  518.     printf("5: Nombre d'emplacement de RAM\n");
  519.     printf("6: Version de la RAM\n");
  520.     printf("7: Nombre de ports PCIE 16\n");
  521.     printf("8: Nombre de ports IDE\n");
  522.     printf("9: Nombre de ports SATA\n");
  523.     printf("10: Nombre de ports USB\n");
  524.     printf("11: Nombre de ports VGA\n");
  525.     printf("12: Nombre de ports DVI\n");
  526.     printf("13: Nombre de ports reseau\n");
  527.     printf("14: Format de la carte\n");
  528.     printf("15: Unique Selling Points\n");
  529.     printf("16: Taux de fiabilite\n");
  530.     printf("17: Restrictions d'usage\n");
  531.     printf("18: Prix\n");
  532.     printf("19: Consommation electrique\n");
  533.     printf("20: Coefficient d'overclocking\n\n");
  534.     printf("0: Quitter la selection\n\n");
  535. }
  536.  
  537. void affichage_ecran(){
  538.     printf("1: Marque\n");
  539.     printf("2: Modele\n");
  540.     printf("3: Taille(en pouces)\n");
  541.     printf("4: Resolution maximale\n");
  542.     printf("5: Type de port\n");
  543.     printf("6: Unique Selling Points\n");
  544.     printf("7: Taux de fiabilite\n");
  545.     printf("8: Restrictions d'usage\n");
  546.     printf("9: Prix\n");
  547.     printf("10: Indice de performance\n");
  548.     printf("11: Consommation electrique\n\n");
  549.     printf("0: Quitter la selection\n\n");
  550. }
  551.  
  552. void affichage_hdd(){
  553.     printf("1: Marque\n");
  554.     printf("2: Modele\n");
  555.     printf("3: Espace disque (en Go)\n");
  556.     printf("4: Type de port\n");
  557.     printf("5: Unique Selling Points\n");
  558.     printf("6: Taux de fiabilite\n");
  559.     printf("7: Restrictions d'usage\n");
  560.     printf("8: Prix\n");
  561.     printf("9: Indice de performance\n");
  562.     printf("10: Consommation electrique\n\n");
  563.     printf("0: Quitter la selection\n\n");
  564. }
  565.  
  566. void affichage_proco(){
  567.     printf("1: Marque\n");
  568.     printf("2: Modele\n");
  569.     printf("3: Type de socket processeur\n");
  570.     printf("4: Frequence\n");
  571.     printf("5: Nombre d'emplacement de RAM supporte\n");
  572.     printf("6: Unique Selling Points\n");
  573.     printf("7: Taux de fiabilite\n");
  574.     printf("8: Restrictions d'usage\n");
  575.     printf("9: Prix\n");
  576.     printf("10: Indice de performance\n");
  577.     printf("11: Consommation electrique\n");
  578.     printf("12: Codefficient d'overclocking\n\n");
  579.     printf("0: Quitter la selection\n\n");
  580. }
  581.  
  582. void affichage_soft(){
  583.     printf("1: Nom du logiciel\n");
  584.     printf("2: RAM necessaire\n");
  585.     printf("3: Espace disque necessaire\n");
  586.     printf("4: Puissance graphique necessaire\n");
  587.     printf("5: Puissance processeur necessaire\n");
  588.     printf("6: Unique Selling Points\n\n");
  589.     printf("0: Quitter la selection\n\n");
  590. }
  591.  
  592. void aff_tab_proco(processeur hist_proco[11], int sz){
  593.     int i;
  594.     printf ("Mrq\tMdl\tSckt\tFreq\tRAM\tUSP\t\tFiab\tRestr\tPrix\tPerf\tCns el\tOvrck\n");
  595.     for (i=0; i<sz; i++)
  596.     {
  597.         printf ("%s\t%s\t%s\t%s\t%s\t%s\t\t%s\t%s\t%s\t%s\t%s\t%s\n", hist_proco[i].marque, hist_proco[i].modele, hist_proco[i].socket, hist_proco[i].frequence, hist_proco[i].nbemplacementRam, hist_proco[i].uniqueSellingPoint, hist_proco[i].fiab, hist_proco[i].restriction, hist_proco[i].prix, hist_proco[i].indiceDePerf, hist_proco[i].consoElec, hist_proco[i].coefOverclock);
  598.     }
  599. }
  600.  
  601. void aff_tab_graphics(Graphics hist_graphic[6], int sz){
  602.     int i;
  603.     printf ("Mrq\tMdl\tVGA\tDVI\tHDMI\tMINIDP\tUSP\tFiab\tRestrict\tPrix\tPerf\tCns el\tOvrclck\n");
  604.     for(i=0; i<sz; i++)
  605.     {
  606.         printf("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", hist_graphic[i].marque, hist_graphic[i].modele, hist_graphic[i].nbr_vga, hist_graphic[i].nbr_dvi, hist_graphic[i].nbr_hdmi, hist_graphic[i].nbr_minidp, hist_graphic[i].usp, hist_graphic[i].fiab, hist_graphic[i].restrict, hist_graphic[i].prix, hist_graphic[i].perf, hist_graphic[i].conso_elec, hist_graphic[i].overclock);
  607.     }
  608. }
  609.  
  610. void aff_tab_soft(Soft hist_soft[6], int sz){
  611.     int i;
  612.     printf ("Nom\tRAM Ness\tEspace\tPuissance graph\tPuissance processeur\tUSP\n");
  613.     for (i=0; i<sz; i++)
  614.     {
  615.         printf ("%s\t%s\t%s\t%s\t%s\t%s\n", hist_soft[i].soft, hist_soft[i].ram, hist_soft[i].rom, hist_soft[i].puis_graph, hist_soft[i].puis_proc, hist_soft[i].usp);
  616.     }
  617. }
  618.  
  619. void aff_tab_hdd(Hdd hist_hdd[9], int sz){
  620.     int i;
  621.     printf ("Marque\tModele\tCapacite\tPort\tUSP\tFiabilite\tRestriction\tPrix\tPerf\tConsommation\n");
  622.     for (i=0; i<sz; i++)
  623.     {
  624.         printf ("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", hist_hdd[i].marque, hist_hdd[i].modele, hist_hdd[i].capa, hist_hdd[i].port, hist_hdd[i].usp, hist_hdd[i].fiab, hist_hdd[i].restrict, hist_hdd[i].prix, hist_hdd[i].perf, hist_hdd[i].conso_elec);
  625.     }
  626. }
  627.  
  628. void aff_tab_motherboard(Motherboard hist_motherboard[10], int sz){
  629.     int i;
  630.     printf("Mrq\tMdl\tSckt\tNbrSckt\tNbrRAM\tVerRAM\tPCIE 16\tIDE\tSATA\tUSB\tVGA\tDVI\tReseau\tFormat\tUSP\tFiab\tRestrict\tPrix\tCns El\tOvrclck\n");
  631.     for (i=0; i<sz; i++)
  632.     {
  633.         printf("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", hist_motherboard[i].marque, hist_motherboard[i].modele, hist_motherboard[i].socket_proc, hist_motherboard[i].nbr_socket, hist_motherboard[i].nbr_ram, hist_motherboard[i].ver_ram, hist_motherboard[i].nbr_pci, hist_motherboard[i].nbr_ide, hist_motherboard[i].nbr_sata, hist_motherboard[i].nbr_usb, hist_motherboard[i].nbr_vga, hist_motherboard[i].nbr_dvi, hist_motherboard[i].nbr_reseau, hist_motherboard[i].format, hist_motherboard[i].usp, hist_motherboard[i].fiab, hist_motherboard[i].restrict, hist_motherboard[i].prix, hist_motherboard[i].conso_elec, hist_motherboard[i].overclock);
  634.     }
  635. }
  636.  
  637. void aff_tab_ecran(caracEcran hist_ecran[9], int sz){
  638.     int i;
  639.     printf ("Mrq\tMdl\tTaille\tResol\tPort\tUSP\t\tFiab\tRestric\tPrix\tPerf \tConso\n");
  640.     for (i=0; i<sz; i++)
  641.     {
  642.         printf ("%s\t%s\t%s\t%s\t%s\t%s\t\t%s\t%s\t%s\t%s\t%s\n", hist_ecran[i].marque, hist_ecran[i].modele, hist_ecran[i].taille, hist_ecran[i].resolMax, hist_ecran[i].typePort, hist_ecran[i].uniqueSellingPoint, hist_ecran[i].fiab, hist_ecran[i].restriction, hist_ecran[i].prix, hist_ecran[i].indiceDePerf, hist_ecran[i].consoElec  );
  643.     }
  644. }
  645.  
  646. void aff_tab_ram(Ram hist_ram[18], int sz){
  647.     int i;
  648.     printf ("Mrq\tMdl\tVersion\tFreq\tRAM\tMod\t\tFiab\tPrix\tPerf\tCns el\tOvrck\n");
  649.     for (i=0; i<sz; i++)
  650.     {
  651.         printf ("%s\t%s\t%s\t%s\t%s\t%s\t\t%s\t%s\t%s\t%s\t%s\n", hist_ram[i].marque, hist_ram[i].modele, hist_ram[i].ver_ram, hist_ram[i].freq, hist_ram[i].ram_mod, hist_ram[i].fiab, hist_ram[i].restrict, hist_ram[i].prix, hist_ram[i].perform, hist_ram[i].cons_elec, hist_ram[i].overclock);
  652.     }
  653. }
  654.  
  655. void demande_proco(processeur proco_array[11], processeur* proco_recherche, processeur hist_proco[11], int sz_proco){
  656.     system("cls");
  657.     int rep;
  658.     processeur nv_proco[11];
  659.     int i;
  660.     int j=0;
  661.     int k=0;
  662.     printf("Quel parametres souhaitez vous parametrer?\n");
  663.     affichage_proco();
  664.     aff_tab_proco(proco_array, sz_proco);
  665.     scanf("%d", &rep);
  666.     if(rep==0)
  667.     {
  668.         //FILE* proco;
  669.         //proco = fopen ("proco.txt","w+");
  670.         //while (l<k)
  671.         //{
  672.          //   fprintf(proco, "%s", );
  673.          //   l++;
  674.         //}
  675.         return;
  676.     }
  677.     if(rep==1)
  678.     {
  679.         printf("Saisir la marque souhaitee\n");
  680.         scanf("%s", proco_recherche->marque);
  681.         for(i=0; i<8; i++)
  682.         {
  683.             if (strcmp(proco_recherche->marque, proco_array[i].marque)==0)
  684.             {
  685.                 j++;
  686.                 hist_proco[k]=proco_array[i];
  687.                 k++;
  688.             }
  689.         }
  690.     }
  691.     if(rep==2)
  692.     {
  693.         printf("Saisir le modele souhaite\n");
  694.         scanf("%s", proco_recherche->modele);
  695.         for(i=0; i<8; i++)
  696.         {
  697.             if (strcmp(proco_recherche->modele, proco_array[i].modele)==0)
  698.             {
  699.                 j++;
  700.                 hist_proco[k]=proco_array[i];
  701.                 k++;
  702.             }
  703.         }
  704.     }
  705.     if(rep==3)
  706.     {
  707.         printf("Saisir le type de socket souhaite\n");
  708.         scanf("%s", proco_recherche->socket);
  709.         for(i=0; i<8; i++)
  710.         {
  711.             if (strcmp(proco_recherche->socket, proco_array[i].socket)==0)
  712.             {
  713.                 j++;
  714.                 hist_proco[k]=proco_array[i];
  715.                 k++;
  716.             }
  717.         }
  718.     }
  719.     if(rep==4)
  720.     {
  721.         printf("Saisir la frequence souhaitee\n");
  722.         scanf("%s", proco_recherche->frequence);
  723.         for(i=0; i<8; i++)
  724.         {
  725.             if (strcmp(proco_recherche->frequence, proco_array[i].frequence)==0)
  726.             {
  727.                 j++;
  728.                 hist_proco[k]=proco_array[i];
  729.                 k++;
  730.             }
  731.         }
  732.     }
  733.     if(rep==5)
  734.     {
  735.         printf("Saisir le nombre d'emplacement RAM souhaite\n");
  736.         scanf("%s", proco_recherche->nbemplacementRam);
  737.         for(i=0; i<8; i++)
  738.         {
  739.             if (strcmp(proco_recherche->nbemplacementRam, proco_array[i].nbemplacementRam)==0)
  740.             {
  741.                 j++;
  742.                 hist_proco[k]=proco_array[i];
  743.                 k++;
  744.             }
  745.         }
  746.     }
  747.     if(rep==6)
  748.     {
  749.         printf("Saisir l'USP souhaite\n");
  750.         scanf("%s", proco_recherche->uniqueSellingPoint);
  751.         for(i=0; i<8; i++)
  752.         {
  753.             if (strcmp(proco_recherche->uniqueSellingPoint, proco_array[i].uniqueSellingPoint)==0)
  754.             {
  755.                 j++;
  756.                 hist_proco[k]=proco_array[i];
  757.                 k++;
  758.             }
  759.         }
  760.     }
  761.     if(rep==7)
  762.     {
  763.         printf("Saisir le taux de fiabilite souhaite\n");
  764.         scanf("%s", proco_recherche->fiab);
  765.         for(i=0; i<8; i++)
  766.         {
  767.             if (strcmp(proco_recherche->fiab, proco_array[i].fiab)==0)
  768.             {
  769.                 j++;
  770.                 hist_proco[k]=proco_array[i];
  771.                 k++;
  772.             }
  773.         }
  774.     }
  775.     if(rep==8)
  776.     {
  777.         printf("Saisir les restrictions d'usage souhaitees\n");
  778.         scanf("%s", proco_recherche->restriction);
  779.         for(i=0; i<8; i++)
  780.         {
  781.             if (strcmp(proco_recherche->restriction, proco_array[i].restriction)==0)
  782.             {
  783.                 j++;
  784.                 hist_proco[k]=proco_array[i];
  785.                 k++;
  786.             }
  787.         }
  788.     }
  789.     if(rep==9)
  790.     {
  791.         printf("Saisir le prix souhaite\n");
  792.         scanf("%s", proco_recherche->prix);
  793.         for(i=0; i<8; i++)
  794.         {
  795.             if (strcmp(proco_recherche->prix, proco_array[i].prix)==0)
  796.             {
  797.                 j++;
  798.                 hist_proco[k]=proco_array[i];
  799.                 k++;
  800.             }
  801.         }
  802.     }
  803.     if(rep==10)
  804.     {
  805.         printf("Saisir la consommation electrique souhaitee\n");
  806.         scanf("%s", proco_recherche->consoElec);
  807.         for(i=0; i<8; i++)
  808.         {
  809.             if (strcmp(proco_recherche->consoElec, proco_array[i].consoElec)==0)
  810.             {
  811.                 j++;
  812.                 hist_proco[k]=proco_array[i];
  813.                 k++;
  814.             }
  815.         }
  816.     }
  817.     if(rep==11)
  818.     {
  819.         printf("Saisir le coefficient d'overclocking souhaite\n");
  820.         scanf("%s", proco_recherche->coefOverclock);
  821.         for(i=0; i<8; i++)
  822.         {
  823.             if (strcmp(proco_recherche->coefOverclock, proco_array[i].coefOverclock)==0)
  824.             {
  825.                 j++;
  826.                 hist_proco[k]=proco_array[i];
  827.                 k++;
  828.             }
  829.         }
  830.     }
  831.  
  832.     if (j!=0) printf("Nous avons trouve %d fois votre config \n", j);
  833.     system("PAUSE");
  834.     sz_proco=k+1;
  835.     demande_proco(hist_proco, proco_recherche, nv_proco, sz_proco);
  836. }
  837.  
  838. void demande_ram(Ram ram_array[18], Ram* ram_recherche, Ram hist_ram[18], int sz_ram){
  839.     int rep;
  840.     int i,j=0;
  841.     int k=0;
  842.     Ram nv_ram[18];
  843.     system("cls");
  844.     printf("Quel parametres souhaitez vous parametrer?\n");
  845.     affichage_ram();
  846.     aff_tab_ram(ram_array, sz_ram);
  847.     scanf("%d", &rep);
  848.     if(rep==0)
  849.     {
  850.         return;
  851.     }
  852.     if(rep==1)
  853.     {
  854.         printf("Saisir la marque souhaitee\n");
  855.         scanf("%s", ram_recherche->marque);
  856.         for(i=0; i<18; i++)
  857.         {
  858.             if (strcmp(ram_recherche->marque, ram_array[i].marque)==0)
  859.             {
  860.                 j++;
  861.                 hist_ram[k]=ram_array[i];
  862.                 k++;
  863.             }
  864.         }
  865.         printf("Nous avons trouve %d fois votre config \n", j);
  866.         system("PAUSE");
  867.     }
  868.     if(rep==2)
  869.     {
  870.         printf("Saisir le modele souhaite\n");
  871.         scanf("%s", ram_recherche->modele);
  872.         for(i=0; i<18; i++)
  873.         {
  874.             if (strcmp(ram_recherche->modele, ram_array[i].modele)==0)
  875.             {
  876.                 j++;
  877.                 hist_ram[k]=ram_array[i];
  878.                 k++;
  879.             }
  880.         }
  881.         printf("Nous avons trouve %d fois votre config \n", j);
  882.         system("PAUSE");
  883.     }
  884.     if(rep==3)
  885.     {
  886.         printf("Saisir la version de la ram\n");
  887.         scanf("%s", ram_recherche->ver_ram);
  888.         for(i=0; i<18; i++)
  889.         {
  890.             if (strcmp(ram_recherche->ver_ram, ram_array[i].ver_ram)==0)
  891.             {
  892.                 j++;
  893.                 hist_ram[k]=ram_array[i];
  894.                 k++;
  895.             }
  896.         }
  897.         printf("Nous avons trouve %d fois votre config \n", j);
  898.         system("PAUSE");
  899.     }
  900.     if(rep==4)
  901.     {
  902.         printf("Saisir la frequence\n");
  903.         scanf("%s", ram_recherche->freq);
  904.         for(i=0; i<18; i++)
  905.         {
  906.             if (strcmp(ram_recherche->freq, ram_array[i].freq)==0)
  907.             {
  908.                 j++;
  909.                 hist_ram[k]=ram_array[i];
  910.                 k++;
  911.             }
  912.         }
  913.         printf("Nous avons trouve %d fois votre config \n", j);
  914.         system("PAUSE");
  915.     }
  916.     if(rep==5)
  917.     {
  918.         printf("Saisir la quantité par module\n");
  919.         scanf("%s", ram_recherche->ram_mod);
  920.         for(i=0; i<18; i++)
  921.         {
  922.             if (strcmp(ram_recherche->ram_mod, ram_array[i].ver_ram)==0)
  923.             {
  924.                 j++;
  925.                 hist_ram[k]=ram_array[i];
  926.                 k++;
  927.             }
  928.         }
  929.         printf("Nous avons trouve %d fois votre config \n", j);
  930.         system("PAUSE");
  931.     }
  932.     if(rep==6)
  933.     {
  934.         printf("Saisir le taux de fiabilite\n");
  935.         scanf("%s", ram_recherche->fiab);
  936.         for(i=0; i<18; i++)
  937.         {
  938.             if (strcmp(ram_recherche->fiab, ram_array[i].ver_ram)==0)
  939.             {
  940.                 j++;
  941.                 hist_ram[k]=ram_array[i];
  942.                 k++;
  943.             }
  944.         }
  945.         printf("Nous avons trouve %d fois votre config \n", j);
  946.         system("PAUSE");
  947.     }
  948.     if(rep==7)
  949.     {
  950.         printf("Saisir le prix\n");
  951.         scanf("%s", ram_recherche->prix);
  952.         for(i=0; i<18; i++)
  953.         {
  954.             if (strcmp(ram_recherche->prix, ram_array[i].ver_ram)==0)
  955.             {
  956.                 j++;
  957.                 hist_ram[k]=ram_array[i];
  958.                 k++;
  959.             }
  960.         }
  961.         printf("Nous avons trouve %d fois votre config \n", j);
  962.         system("PAUSE");
  963.     }
  964.     if(rep==8)
  965.     {
  966.         printf("Saisir l'indice de performance\n");
  967.         scanf("%s", ram_recherche->perform);
  968.         for(i=0; i<18; i++)
  969.         {
  970.             if (strcmp(ram_recherche->perform, ram_array[i].ver_ram)==0)
  971.             {
  972.                 j++;
  973.                 hist_ram[k]=ram_array[i];
  974.                 k++;
  975.             }
  976.         }
  977.         printf("Nous avons trouve %d fois votre config \n", j);
  978.         system("PAUSE");
  979.     }
  980.     if(rep==9)
  981.     {
  982.         printf("Saisir la consommation electrique\n");
  983.         scanf("%s", ram_recherche->cons_elec);
  984.         for(i=0; i<18; i++)
  985.         {
  986.             if (strcmp(ram_recherche->cons_elec, ram_array[i].ver_ram)==0)
  987.             {
  988.                 j++;
  989.                 hist_ram[k]=ram_array[i];
  990.                 k++;
  991.             }
  992.         }
  993.         printf("Nous avons trouve %d fois votre config \n", j);
  994.         system("PAUSE");
  995.     }
  996.     if(rep==10)
  997.     {
  998.         printf("Saisir le coefficient d'overclocking\n");
  999.         scanf("%s", ram_recherche->overclock);
  1000.         for(i=0; i<18; i++)
  1001.         {
  1002.             if (strcmp(ram_recherche->overclock, ram_array[i].ver_ram)==0)
  1003.             {
  1004.                 j++;
  1005.                 hist_ram[k]=ram_array[i];
  1006.                 k++;
  1007.             }
  1008.         }
  1009.         printf("Nous avons trouve %d fois votre config \n", j);
  1010.         system("PAUSE");
  1011.     }
  1012.     demande_ram(hist_ram, ram_recherche, nv_ram, k+1);
  1013. }
  1014.  
  1015. void demande_graphics(Graphics graphics_array[6], Graphics* graphics_recherche, Graphics hist_graphic[6], int sz_graphic){
  1016.     int rep;
  1017.     int i;
  1018.     int j=0;
  1019.     int k=0;
  1020.     Graphics nv_graphic[6];
  1021.     system("cls");
  1022.     printf("Quel parametres souhaitez vous parametrer?\n");
  1023.     affichage_graphics();
  1024.     aff_tab_graphics(graphics_array, sz_graphic);
  1025.     scanf("%d", &rep);
  1026.     if(rep==0)
  1027.     {
  1028.         return;
  1029.     }
  1030.     if(rep==1)
  1031.     {
  1032.         printf("Saisir la marque souhaitee\n");
  1033.         scanf("%s", graphics_recherche->marque);
  1034.         for(i=0; i<6; i++)
  1035.         {
  1036.             if (strcmp(graphics_recherche->marque, graphics_array[i].marque)==0)
  1037.             {
  1038.                 j++;
  1039.                 hist_graphic[k]=graphics_array[i];
  1040.                 k++;
  1041.             }
  1042.         }
  1043.         printf("Nous avons trouve %d fois votre config \n", j);
  1044.         system("PAUSE");
  1045.     }
  1046.     if(rep==2)
  1047.     {
  1048.         printf("Saisir le modele souhaite\n");
  1049.         scanf("%s", graphics_recherche->modele);
  1050.         for(i=0; i<6; i++)
  1051.         {
  1052.             if (strcmp(graphics_recherche->modele, graphics_array[i].modele)==0)
  1053.             {
  1054.                 j++;
  1055.                 hist_graphic[k]=graphics_array[i];
  1056.                 k++;
  1057.             }
  1058.         }
  1059.         printf("Nous avons trouve %d fois votre config \n", j);
  1060.         system("PAUSE");
  1061.     }
  1062.     if(rep==3)
  1063.     {
  1064.         printf("Saisir le nombre de ports VGA\n");
  1065.         scanf("%s", graphics_recherche->nbr_vga);
  1066.         for(i=0; i<6; i++)
  1067.         {
  1068.             if (strcmp(graphics_recherche->nbr_vga, graphics_array[i].nbr_vga)==0)
  1069.             {
  1070.                 j++;
  1071.                 hist_graphic[k]=graphics_array[i];
  1072.                 k++;
  1073.             }
  1074.         }
  1075.         printf("Nous avons trouve %d fois votre config \n", j);
  1076.         system("PAUSE");
  1077.     }
  1078.     if(rep==4)
  1079.     {
  1080.         printf("Saisir le nombre de ports DVI\n");
  1081.         scanf("%s", graphics_recherche->nbr_dvi);
  1082.         for(i=0; i<6; i++)
  1083.         {
  1084.             if (strcmp(graphics_recherche->nbr_dvi, graphics_array[i].nbr_dvi)==0)
  1085.             {
  1086.                 j++;
  1087.                 hist_graphic[k]=graphics_array[i];
  1088.                 k++;
  1089.             }
  1090.         }
  1091.         printf("Nous avons trouve %d fois votre config \n", j);
  1092.         system("PAUSE");
  1093.     }
  1094.     if(rep==5)
  1095.     {
  1096.         printf("Saisir le nombre de ports HDMI\n");
  1097.         scanf("%s", graphics_recherche->nbr_hdmi);
  1098.         for(i=0; i<6; i++)
  1099.         {
  1100.             if (strcmp(graphics_recherche->nbr_hdmi, graphics_array[i].nbr_hdmi)==0)
  1101.             {
  1102.                 j++;
  1103.                 hist_graphic[k]=graphics_array[i];
  1104.                 k++;
  1105.             }
  1106.         }
  1107.         printf("Nous avons trouve %d fois votre config \n", j);
  1108.         system("PAUSE");
  1109.     }
  1110.     if(rep==6)
  1111.     {
  1112.         printf("Saisir le nombre de ports MINIDP\n");
  1113.         scanf("%s", graphics_recherche->nbr_minidp);
  1114.         for(i=0; i<6; i++)
  1115.         {
  1116.             if (strcmp(graphics_recherche->nbr_minidp, graphics_array[i].nbr_minidp)==0)
  1117.             {
  1118.                 j++;
  1119.                 hist_graphic[k]=graphics_array[i];
  1120.                 k++;
  1121.             }
  1122.         }
  1123.         printf("Nous avons trouve %d fois votre config \n", j);
  1124.         system("PAUSE");
  1125.     }
  1126.     if(rep==7)
  1127.     {
  1128.         printf("Saisir l'USP\n");
  1129.         scanf("%s", graphics_recherche->usp);
  1130.         for(i=0; i<6; i++)
  1131.         {
  1132.             if (strcmp(graphics_recherche->usp, graphics_array[i].usp)==0)
  1133.             {
  1134.                 j++;
  1135.                 hist_graphic[k]=graphics_array[i];
  1136.                 k++;
  1137.             }
  1138.         }
  1139.         printf("Nous avons trouve %d fois votre config \n", j);
  1140.         system("PAUSE");
  1141.     }
  1142.     if(rep==8)
  1143.     {
  1144.         printf("Saisir les restrictions d'usage\n");
  1145.         scanf("%s", graphics_recherche->restrict);
  1146.         for(i=0; i<6; i++)
  1147.         {
  1148.             if (strcmp(graphics_recherche->restrict, graphics_array[i].restrict)==0)
  1149.             {
  1150.                 j++;
  1151.                 hist_graphic[k]=graphics_array[i];
  1152.                 k++;
  1153.             }
  1154.         }
  1155.         printf("Nous avons trouve %d fois votre config \n", j);
  1156.         system("PAUSE");
  1157.     }
  1158.     if(rep==9)
  1159.     {
  1160.         printf("Saisir le prix\n");
  1161.         scanf("%s", graphics_recherche->prix);
  1162.         for(i=0; i<6; i++)
  1163.         {
  1164.             if (strcmp(graphics_recherche->prix, graphics_array[i].prix)==0)
  1165.             {
  1166.                 j++;
  1167.                 hist_graphic[k]=graphics_array[i];
  1168.                 k++;
  1169.             }
  1170.         }
  1171.         printf("Nous avons trouve %d fois votre config \n", j);
  1172.         system("PAUSE");
  1173.     }
  1174.     if(rep==10)
  1175.     {
  1176.         printf("Saisir l'indice de performance\n");
  1177.         scanf("%s", graphics_recherche->perf);
  1178.         for(i=0; i<6; i++)
  1179.         {
  1180.             if (strcmp(graphics_recherche->perf, graphics_array[i].perf)==0)
  1181.             {
  1182.                 j++;
  1183.                 hist_graphic[k]=graphics_array[i];
  1184.                 k++;
  1185.             }
  1186.         }
  1187.         printf("Nous avons trouve %d fois votre config\n", j);
  1188.         system("PAUSE");
  1189.     }
  1190.     if(rep==11)
  1191.     {
  1192.         printf("Saisir la consommation electrique\n");
  1193.         scanf("%s", graphics_recherche->conso_elec);
  1194.         for(i=0; i<6; i++)
  1195.         {
  1196.             if (strcmp(graphics_recherche->conso_elec, graphics_array[i].conso_elec)==0)
  1197.             {
  1198.                 j++;
  1199.                 hist_graphic[k]=graphics_array[i];
  1200.                 k++;
  1201.             }
  1202.         }
  1203.         printf("Nous avons trouve %d fois votre config\n", j);
  1204.         system("PAUSE");
  1205.     }
  1206.     if(rep==12)
  1207.     {
  1208.         printf("Saisir le coefficient d'overclocking\n");
  1209.         scanf("%s", graphics_recherche->overclock);
  1210.         for(i=0; i<6; i++)
  1211.         {
  1212.             if (strcmp(graphics_recherche->overclock, graphics_array[i].overclock)==0)
  1213.             {
  1214.                 j++;
  1215.                 hist_graphic[k]=graphics_array[i];
  1216.                 k++;
  1217.             }
  1218.         }
  1219.         printf("Nous avons trouve %d fois votre config\n", j);
  1220.         system("PAUSE");
  1221.     }
  1222.     demande_graphics(hist_graphic, graphics_recherche, nv_graphic, k+1);
  1223. }
  1224.  
  1225. void demande_motherboard(Motherboard motherboard_array[10], Motherboard* motherboard_recherche, Motherboard hist_motherboard[10], int sz_motherboard){
  1226.     int rep;
  1227.     int i;
  1228.     int j=0;
  1229.     int k=0;
  1230.     Motherboard nv_motherboard[10];
  1231.     system("cls");
  1232.     printf("Quel parametres souhaitez vous parametrer?\n");
  1233.     affichage_motherboard();
  1234.     aff_tab_motherboard(motherboard_array, sz_motherboard);
  1235.     scanf("%d", &rep);
  1236.     if(rep==0)
  1237.     {
  1238.         return;
  1239.     }
  1240.     if(rep==1)
  1241.     {
  1242.         printf("Saisir la marque souhaitee\n");
  1243.         scanf("%s", motherboard_recherche->marque);
  1244.         for(i=0; i<10; i++)
  1245.         {
  1246.             if (strcmp(motherboard_recherche->marque, motherboard_array[i].marque)==0)
  1247.             {
  1248.                 j++;
  1249.                 hist_motherboard[k]=motherboard_array[i];
  1250.                 k++;
  1251.             }
  1252.         }
  1253.     }
  1254.     if(rep==2)
  1255.     {
  1256.         printf("Saisir le modele souhaite\n");
  1257.         scanf("%s", motherboard_recherche->modele);
  1258.         for(i=0; i<10; i++)
  1259.         {
  1260.             if (strcmp(motherboard_recherche->modele, motherboard_array[i].modele)==0)
  1261.             {
  1262.                 j++;
  1263.                 hist_motherboard[k]=motherboard_array[i];
  1264.                 k++;
  1265.             }
  1266.         }
  1267.     }
  1268.     if(rep==3)
  1269.     {
  1270.         printf("Saisir le type de socket processeur souhaite\n");
  1271.         scanf("%s", motherboard_recherche->socket_proc);
  1272.         for(i=0; i<10; i++)
  1273.         {
  1274.             if (strcmp(motherboard_recherche->socket_proc, motherboard_array[i].socket_proc)==0)
  1275.             {
  1276.                 j++;
  1277.                 hist_motherboard[k]=motherboard_array[i];
  1278.                 k++;
  1279.             }
  1280.         }
  1281.     }
  1282.     if(rep==4)
  1283.     {
  1284.         printf("Saisir le nombre de socket souhaite\n");
  1285.         scanf("%s", motherboard_recherche->nbr_socket);
  1286.         for(i=0; i<10; i++)
  1287.         {
  1288.             if (strcmp(motherboard_recherche->nbr_socket, motherboard_array[i].nbr_socket)==0)
  1289.             {
  1290.                 j++;
  1291.                 hist_motherboard[k]=motherboard_array[i];
  1292.                 k++;
  1293.             }
  1294.         }
  1295.     }
  1296.     if(rep==5)
  1297.     {
  1298.         printf("Saisir le nombre d'emplacement RAM souhaite\n");
  1299.         scanf("%s", motherboard_recherche->nbr_ram);
  1300.         for(i=0; i<10; i++)
  1301.         {
  1302.             if (strcmp(motherboard_recherche->nbr_ram, motherboard_array[i].nbr_ram)==0)
  1303.             {
  1304.                 j++;
  1305.                 hist_motherboard[k]=motherboard_array[i];
  1306.                 k++;
  1307.             }
  1308.         }
  1309.     }
  1310.     if(rep==5)
  1311.     {
  1312.         printf("Saisir la version de la RAM souhaitee\n");
  1313.         scanf("%s", motherboard_recherche->ver_ram);
  1314.         for(i=0; i<10; i++)
  1315.         {
  1316.             if (strcmp(motherboard_recherche->ver_ram, motherboard_array[i].ver_ram)==0)
  1317.             {
  1318.                 j++;
  1319.                 hist_motherboard[k]=motherboard_array[i];
  1320.                 k++;
  1321.             }
  1322.         }
  1323.     }
  1324.     if(rep==7)
  1325.     {
  1326.         printf("Saisir le nombre de ports PCIE 16 souhaite\n");
  1327.         scanf("%s", motherboard_recherche->nbr_pci);
  1328.         for(i=0; i<10; i++)
  1329.         {
  1330.             if (strcmp(motherboard_recherche->nbr_pci, motherboard_array[i].nbr_pci)==0)
  1331.             {
  1332.                 j++;
  1333.                 hist_motherboard[k]=motherboard_array[i];
  1334.                 k++;
  1335.             }
  1336.         }
  1337.     }
  1338.     if(rep==8)
  1339.     {
  1340.         printf("Saisir le nombre de ports IDE souhaite\n");
  1341.         scanf("%s", motherboard_recherche->nbr_ide);
  1342.         for(i=0; i<10; i++)
  1343.         {
  1344.             if (strcmp(motherboard_recherche->nbr_ide, motherboard_array[i].nbr_ide)==0)
  1345.             {
  1346.                 j++;
  1347.                 hist_motherboard[k]=motherboard_array[i];
  1348.                 k++;
  1349.             }
  1350.         }
  1351.     }
  1352.     if(rep==9)
  1353.     {
  1354.         printf("Saisir le nombre de ports SATA souhaite\n");
  1355.         scanf("%s", motherboard_recherche->nbr_sata);
  1356.         for(i=0; i<10; i++)
  1357.         {
  1358.             if (strcmp(motherboard_recherche->nbr_sata, motherboard_array[i].nbr_sata)==0)
  1359.             {
  1360.                 j++;
  1361.                 hist_motherboard[k]=motherboard_array[i];
  1362.                 k++;
  1363.             }
  1364.         }
  1365.     }
  1366.     if(rep==10)
  1367.     {
  1368.         printf("Saisir le nombre de ports USB souhaite\n");
  1369.         scanf("%s", motherboard_recherche->nbr_usb);
  1370.         for(i=0; i<10; i++)
  1371.         {
  1372.             if (strcmp(motherboard_recherche->nbr_usb, motherboard_array[i].nbr_usb)==0)
  1373.             {
  1374.                 j++;
  1375.                 hist_motherboard[k]=motherboard_array[i];
  1376.                 k++;
  1377.             }
  1378.         }
  1379.     }
  1380.     if(rep==11)
  1381.     {
  1382.         printf("Saisir le nombre de ports VGA souhaite\n");
  1383.         scanf("%s", motherboard_recherche->nbr_vga);
  1384.         for(i=0; i<10; i++)
  1385.         {
  1386.             if (strcmp(motherboard_recherche->nbr_vga, motherboard_array[i].nbr_vga)==0)
  1387.             {
  1388.                 j++;
  1389.                 hist_motherboard[k]=motherboard_array[i];
  1390.                 k++;
  1391.             }
  1392.         }
  1393.     }
  1394.     if(rep==12)
  1395.     {
  1396.         printf("Saisir le nombre de ports DVI souhaite\n");
  1397.         scanf("%s", motherboard_recherche->nbr_dvi);
  1398.         for(i=0; i<10; i++)
  1399.         {
  1400.             if (strcmp(motherboard_recherche->nbr_dvi, motherboard_array[i].nbr_dvi)==0)
  1401.             {
  1402.                 j++;
  1403.                 hist_motherboard[k]=motherboard_array[i];
  1404.                 k++;
  1405.             }
  1406.         }
  1407.     }
  1408.     if(rep==13)
  1409.     {
  1410.         printf("Saisir le nombre de ports reseau souhaite\n");
  1411.         scanf("%s", motherboard_recherche->nbr_reseau);
  1412.         for(i=0; i<10; i++)
  1413.         {
  1414.             if (strcmp(motherboard_recherche->nbr_dvi, motherboard_array[i].nbr_dvi)==0)
  1415.             {
  1416.                 j++;
  1417.                 hist_motherboard[k]=motherboard_array[i];
  1418.                 k++;
  1419.             }
  1420.         }
  1421.     }
  1422.     if(rep==14)
  1423.     {
  1424.         printf("Saisir le format souhaite\n");
  1425.         scanf("%s", motherboard_recherche->format);
  1426.         for(i=0; i<10; i++)
  1427.         {
  1428.             if (strcmp(motherboard_recherche->format, motherboard_array[i].format)==0)
  1429.             {
  1430.                 j++;
  1431.                 hist_motherboard[k]=motherboard_array[i];
  1432.                 k++;
  1433.             }
  1434.         }
  1435.     }
  1436.     if(rep==15)
  1437.     {
  1438.         printf("Saisir l'USP souhaite\n");
  1439.         scanf("%s", motherboard_recherche->usp);
  1440.         for(i=0; i<10; i++)
  1441.         {
  1442.             if (strcmp(motherboard_recherche->usp, motherboard_array[i].usp)==0)
  1443.             {
  1444.                 j++;
  1445.                 hist_motherboard[k]=motherboard_array[i];
  1446.                 k++;
  1447.             }
  1448.         }
  1449.     }
  1450.     if(rep==16)
  1451.     {
  1452.         printf("Saisir le taux de fiabilité souhaite\n");
  1453.         scanf("%s", motherboard_recherche->fiab);
  1454.         for(i=0; i<10; i++)
  1455.         {
  1456.             if (strcmp(motherboard_recherche->fiab, motherboard_array[i].fiab)==0)
  1457.             {
  1458.                 j++;
  1459.                 hist_motherboard[k]=motherboard_array[i];
  1460.                 k++;
  1461.             }
  1462.         }
  1463.     }
  1464.     if(rep==17)
  1465.     {
  1466.         printf("Saisir les restrictions d'usage souhaitees\n");
  1467.         scanf("%s", motherboard_recherche->restrict);
  1468.         for(i=0; i<10; i++)
  1469.         {
  1470.             if (strcmp(motherboard_recherche->restrict, motherboard_array[i].restrict)==0)
  1471.             {
  1472.                 j++;
  1473.                 hist_motherboard[k]=motherboard_array[i];
  1474.                 k++;
  1475.             }
  1476.         }
  1477.     }
  1478.     if(rep==18)
  1479.     {
  1480.         printf("Saisir le prix souhaite\n");
  1481.         scanf("%s", motherboard_recherche->prix);
  1482.         for(i=0; i<10; i++)
  1483.         {
  1484.             if (strcmp(motherboard_recherche->prix, motherboard_array[i].prix)==0)
  1485.             {
  1486.                 j++;
  1487.                 hist_motherboard[k]=motherboard_array[i];
  1488.                 k++;
  1489.             }
  1490.         }
  1491.     }
  1492.     if(rep==19)
  1493.     {
  1494.         printf("Saisir la consommation electrique souhaitee\n");
  1495.         scanf("%s", motherboard_recherche->conso_elec);
  1496.         for(i=0; i<10; i++)
  1497.         {
  1498.             if (strcmp(motherboard_recherche->conso_elec, motherboard_array[i].conso_elec)==0)
  1499.             {
  1500.                 j++;
  1501.                 hist_motherboard[k]=motherboard_array[i];
  1502.                 k++;
  1503.             }
  1504.         }
  1505.     }
  1506.     if(rep==20)
  1507.     {
  1508.         printf("Saisir le coefficient d'overclocking souhaite\n");
  1509.         scanf("%s", motherboard_recherche->overclock);
  1510.         for(i=0; i<10; i++)
  1511.         {
  1512.             if (strcmp(motherboard_recherche->overclock, motherboard_array[i].overclock)==0)
  1513.             {
  1514.                 j++;
  1515.                 hist_motherboard[k]=motherboard_array[i];
  1516.                 k++;
  1517.             }
  1518.         }
  1519.     }
  1520.     if (j!=0) printf("Nous avons trouve %d fois votre config \n", j);
  1521.     system("PAUSE");
  1522.     demande_motherboard(hist_motherboard, motherboard_recherche, nv_motherboard, k+1);
  1523. }
  1524.  
  1525. void demande_hdd(Hdd hdd_array[9], Hdd* hdd_recherche, Hdd hist_hdd[9], int sz_hdd){
  1526.     int rep;
  1527.     int i;
  1528.     int j=0;
  1529.     int k=0;
  1530.     Hdd nv_hdd[9];
  1531.     system("cls");
  1532.     printf("Quel parametres souhaitez vous parametrer?\n");
  1533.     affichage_hdd();
  1534.     aff_tab_hdd(hdd_array, sz_hdd);
  1535.     scanf("%d", &rep);
  1536.     if(rep==0)
  1537.     {
  1538.         return;
  1539.     }
  1540.     if(rep==1)
  1541.     {
  1542.         printf("Saisir la marque souhaitee\n");
  1543.         scanf("%s", hdd_recherche->marque);
  1544.         for(i=0; i<8; i++)
  1545.         {
  1546.             if (strcmp(hdd_recherche->marque, hdd_array[i].marque)==0)
  1547.             {
  1548.                 j++;
  1549.                 hist_hdd[k]=hdd_array[i];
  1550.                 k++;
  1551.             }
  1552.         }
  1553.     }
  1554.     if(rep==2)
  1555.     {
  1556.         printf("Saisir le modele souhaite\n");
  1557.         scanf("%s", hdd_recherche->modele);
  1558.         for(i=0; i<8; i++)
  1559.         {
  1560.             if (strcmp(hdd_recherche->modele, hdd_array[i].modele)==0)
  1561.             {
  1562.                 j++;
  1563.                 hist_hdd[k]=hdd_array[i];
  1564.                 k++;
  1565.             }
  1566.         }
  1567.     }
  1568.     if(rep==3)
  1569.     {
  1570.         printf("Saisir l'espace disque (en Go) souhaite\n");
  1571.         scanf("%s", hdd_recherche->capa);
  1572.         for(i=0; i<8; i++)
  1573.         {
  1574.             if (strcmp(hdd_recherche->capa, hdd_array[i].capa)==0)
  1575.             {
  1576.                 j++;
  1577.                 hist_hdd[k]=hdd_array[i];
  1578.                 k++;
  1579.             }
  1580.         }
  1581.     }
  1582.     if(rep==4)
  1583.     {
  1584.         printf("Saisir le type de port souhaite\n");
  1585.         scanf("%s", hdd_recherche->port);
  1586.         for(i=0; i<8; i++)
  1587.         {
  1588.             if (strcmp(hdd_recherche->port, hdd_array[i].port)==0)
  1589.             {
  1590.                 j++;
  1591.                 hist_hdd[k]=hdd_array[i];
  1592.                 k++;
  1593.             }
  1594.         }
  1595.     }
  1596.     if(rep==5)
  1597.     {
  1598.         printf("Saisir l'USP souhaite\n");
  1599.         scanf("%s", hdd_recherche->usp);
  1600.         for(i=0; i<8; i++)
  1601.         {
  1602.             if (strcmp(hdd_recherche->usp, hdd_array[i].usp)==0)
  1603.             {
  1604.                 j++;
  1605.                 hist_hdd[k]=hdd_array[i];
  1606.                 k++;
  1607.             }
  1608.         }
  1609.     }
  1610.     if(rep==6)
  1611.     {
  1612.         printf("Saisir le taux de fiabilite souhaite\n");
  1613.         scanf("%s", hdd_recherche->fiab);
  1614.         for(i=0; i<8; i++)
  1615.         {
  1616.             if (strcmp(hdd_recherche->fiab, hdd_array[i].fiab)==0)
  1617.             {
  1618.                 j++;
  1619.                 hist_hdd[k]=hdd_array[i];
  1620.                 k++;
  1621.             }
  1622.         }
  1623.     }
  1624.     if(rep==7)
  1625.     {
  1626.         printf("Saisir les restrictions d'usage souhaitees\n");
  1627.         scanf("%s", hdd_recherche->restrict);
  1628.         for(i=0; i<8; i++)
  1629.         {
  1630.             if (strcmp(hdd_recherche->restrict, hdd_array[i].restrict)==0)
  1631.             {
  1632.                 j++;
  1633.                 hist_hdd[k]=hdd_array[i];
  1634.                 k++;
  1635.             }
  1636.         }
  1637.     }
  1638.     if(rep==8)
  1639.     {
  1640.         printf("Saisir le prix souhaite\n");
  1641.         scanf("%s", hdd_recherche->prix);
  1642.         for(i=0; i<8; i++)
  1643.         {
  1644.             if (strcmp(hdd_recherche->prix, hdd_array[i].prix)==0)
  1645.             {
  1646.                 j++;
  1647.                 hist_hdd[k]=hdd_array[i];
  1648.                 k++;
  1649.             }
  1650.         }
  1651.     }
  1652.     if(rep==9)
  1653.     {
  1654.         printf("Saisir l'indice de performance souhaite\n");
  1655.         scanf("%s", hdd_recherche->perf);
  1656.         for(i=0; i<8; i++)
  1657.         {
  1658.             if (strcmp(hdd_recherche->perf, hdd_array[i].perf)==0)
  1659.             {
  1660.                 j++;
  1661.                 hist_hdd[k]=hdd_array[i];
  1662.                 k++;
  1663.             }
  1664.         }
  1665.     }
  1666.     if(rep==10)
  1667.     {
  1668.         printf("Saisir la consommation electrique souhaitee\n");
  1669.         scanf("%s", hdd_recherche->conso_elec);
  1670.         for(i=0; i<8; i++)
  1671.         {
  1672.             if (strcmp(hdd_recherche->conso_elec, hdd_array[i].conso_elec)==0)
  1673.             {
  1674.                 j++;
  1675.                 hist_hdd[k]=hdd_array[i];
  1676.                 k++;
  1677.             }
  1678.         }
  1679.     }
  1680.     if (j!=0) printf("Nous avons trouve %d fois votre config\n", j);
  1681.     system("PAUSE");
  1682.     demande_hdd(hist_hdd, hdd_recherche, nv_hdd, k+1);
  1683. }
  1684.  
  1685. void demande_ecran(caracEcran ecran_array[9], caracEcran* ecran_recherche, caracEcran hist_ecran[9], int sz_ecran){
  1686.     int rep;
  1687.     int i;
  1688.     int j=0;
  1689.     int k=0;
  1690.     caracEcran nv_ecran[9];
  1691.     system("cls");
  1692.     printf("Quel parametres souhaitez vous parametrer?\n");
  1693.     affichage_ecran();
  1694.     aff_tab_ecran(ecran_array, sz_ecran);
  1695.     scanf("%d", &rep);if(rep==0)
  1696.     {
  1697.         return;
  1698.     }
  1699.     if(rep==1)
  1700.     {
  1701.         printf("Saisir la marque souhaitee\n");
  1702.         scanf("%s", ecran_recherche->marque);
  1703.         for(i=0; i<5; i++)
  1704.         {
  1705.             if (strcmp(ecran_recherche->marque, ecran_array[i].marque)==0)
  1706.             {
  1707.                 j++;
  1708.                 hist_ecran[k]=ecran_array[i];
  1709.                 k++;
  1710.             }
  1711.         }
  1712.     }
  1713.     if(rep==2)
  1714.     {
  1715.         printf("Saisir le modele souhaite\n");
  1716.         scanf("%s", ecran_recherche->modele);
  1717.         for(i=0; i<5; i++)
  1718.         {
  1719.             if (strcmp(ecran_recherche->modele, ecran_array[i].modele)==0)
  1720.             {
  1721.                 j++;
  1722.                 hist_ecran[k]=ecran_array[i];
  1723.                 k++;
  1724.             }
  1725.         }
  1726.     }
  1727.     if(rep==3)
  1728.     {
  1729.         printf("Saisir la taille en pouce souhaite\n");
  1730.         scanf("%s", ecran_recherche->taille);
  1731.         for(i=0; i<5; i++)
  1732.         {
  1733.             if (strcmp(ecran_recherche->taille, ecran_array[i].taille)==0)
  1734.             {
  1735.                 j++;
  1736.                 hist_ecran[k]=ecran_array[i];
  1737.                 k++;
  1738.             }
  1739.         }
  1740.     }
  1741.     if(rep==4)
  1742.     {
  1743.         printf("Saisir la resolution maximale souhaitée\n");
  1744.         scanf("%s", ecran_recherche->resolMax);
  1745.         for(i=0; i<5; i++)
  1746.         {
  1747.             if (strcmp(ecran_recherche->resolMax, ecran_array[i].resolMax)==0)
  1748.             {
  1749.                 j++;
  1750.                 hist_ecran[k]=ecran_array[i];
  1751.                 k++;
  1752.             }
  1753.         }
  1754.     }
  1755.     if(rep==5)
  1756.     {
  1757.         printf("Saisir le type de port souhaite\n");
  1758.         scanf("%s", ecran_recherche->typePort);
  1759.         for(i=0; i<5; i++)
  1760.         {
  1761.             if (strcmp(ecran_recherche->typePort, ecran_array[i].typePort)==0)
  1762.             {
  1763.                 j++;
  1764.                 hist_ecran[k]=ecran_array[i];
  1765.                 k++;
  1766.             }
  1767.         }
  1768.     }
  1769.     if(rep==6)
  1770.     {
  1771.         printf("Saisir le seul point de vente souhaite\n");
  1772.         scanf("%s", ecran_recherche->uniqueSellingPoint);
  1773.         for(i=0; i<5; i++)
  1774.         {
  1775.             if (strcmp(ecran_recherche->uniqueSellingPoint, ecran_array[i].uniqueSellingPoint)==0)
  1776.             {
  1777.                 j++;
  1778.                 hist_ecran[k]=ecran_array[i];
  1779.                 k++;
  1780.             }
  1781.         }
  1782.     }
  1783.     if(rep==7)
  1784.     {
  1785.         printf("Saisir le taux de fiabilité souhaitees\n");
  1786.         scanf("%s", ecran_recherche->fiab);
  1787.         for(i=0; i<5; i++)
  1788.         {
  1789.             if (strcmp(ecran_recherche->fiab, ecran_array[i].fiab)==0)
  1790.             {
  1791.                 j++;
  1792.                 hist_ecran[k]=ecran_array[i];
  1793.                 k++;
  1794.             }
  1795.         }
  1796.     }
  1797.     if(rep==8)
  1798.     {
  1799.         printf("Saisir les restrictions d'usage souhaites\n");
  1800.         scanf("%s", ecran_recherche->restriction);
  1801.         for(i=0; i<5; i++)
  1802.         {
  1803.             if (strcmp(ecran_recherche->restriction, ecran_array[i].restriction)==0)
  1804.             {
  1805.                 j++;
  1806.                 hist_ecran[k]=ecran_array[i];
  1807.                 k++;
  1808.             }
  1809.         }
  1810.     }
  1811.     if(rep==9)
  1812.     {
  1813.         printf("Saisir le prix souhaite\n");
  1814.         scanf("%s", ecran_recherche->prix);
  1815.         for(i=0; i<5; i++)
  1816.         {
  1817.             if (strcmp(ecran_recherche->prix, ecran_array[i].prix)==0)
  1818.             {
  1819.                 j++;
  1820.                 hist_ecran[k]=ecran_array[i];
  1821.                 k++;
  1822.             }
  1823.         }
  1824.     }
  1825.     if(rep==10)
  1826.     {
  1827.         printf("Saisir l'indice de performance souhaitee\n");
  1828.         scanf("%s", ecran_recherche->indiceDePerf);
  1829.         for(i=0; i<5; i++)
  1830.         {
  1831.             if (strcmp(ecran_recherche->indiceDePerf, ecran_array[i].indiceDePerf)==0)
  1832.             {
  1833.                 j++;
  1834.                 hist_ecran[k]=ecran_array[i];
  1835.                 k++;
  1836.             }
  1837.         }
  1838.     }
  1839.     if(rep==11)
  1840.     {
  1841.         printf("Saisir la consommation electrique souhaitee\n");
  1842.         scanf("%s", ecran_recherche->consoElec);
  1843.         for(i=0; i<5; i++)
  1844.         {
  1845.             if (strcmp(ecran_recherche->consoElec, ecran_array[i].consoElec)==0)
  1846.             {
  1847.                 j++;
  1848.                 hist_ecran[k]=ecran_array[i];
  1849.                 k++;
  1850.             }
  1851.         }
  1852.     }
  1853.     if (j!=0) printf("Nous avons trouve %d fois votre config\n", j);
  1854.     system("PAUSE");
  1855.     demande_ecran(hist_ecran, ecran_recherche, nv_ecran, k+1);
  1856. }
  1857.  
  1858. void demande_soft(Soft soft_array[6], Soft* soft_recherche, Soft hist_soft[6], int sz_soft){
  1859.     int rep;
  1860.     int i;
  1861.     int j=0;
  1862.     int k=0;
  1863.     Soft nv_soft[6];
  1864.     system("cls");
  1865.     printf("Quel parametres souhaitez vous parametrer?\n");
  1866.     affichage_soft();
  1867.     aff_tab_soft(soft_array, sz_soft);
  1868.     scanf("%d", &rep);
  1869.     if(rep==0)
  1870.     {
  1871.         return;
  1872.     }
  1873.     if(rep==1)
  1874.     {
  1875.         printf("Saisir le logiciel souhaite\n");
  1876.         scanf("%s", soft_recherche->soft);
  1877.         for(i=0; i<6; i++)
  1878.         {
  1879.             if (strcmp(soft_recherche->soft, soft_array[i].soft)==0)
  1880.             {
  1881.                 j++;
  1882.                 hist_soft[k]=soft_array[i];
  1883.                 k++;
  1884.             }
  1885.         }
  1886.     }
  1887.     if(rep==2)
  1888.     {
  1889.         printf("Saisir la RAM necessaire souhaite\n");
  1890.         scanf("%s", soft_recherche->ram);
  1891.         for(i=0; i<6; i++)
  1892.         {
  1893.             if (strcmp(soft_recherche->ram, soft_array[i].ram)==0)
  1894.             {
  1895.                 j++;
  1896.                 hist_soft[k]=soft_array[i];
  1897.                 k++;
  1898.             }
  1899.         }
  1900.     }
  1901.     if(rep==3)
  1902.     {
  1903.         printf("Saisir l'espace disque (en Go) necessaire  souhaite\n");
  1904.         scanf("%s", soft_recherche->rom);
  1905.         for(i=0; i<6; i++)
  1906.         {
  1907.             if (strcmp(soft_recherche->rom, soft_array[i].rom)==0)
  1908.             {
  1909.                 j++;
  1910.                 hist_soft[k]=soft_array[i];
  1911.                 k++;
  1912.             }
  1913.         }
  1914.     }
  1915.     if(rep==4)
  1916.     {
  1917.         printf("Saisir la puissance graphique necessaire souhaitee\n");
  1918.         scanf("%s", soft_recherche->puis_graph);
  1919.         for(i=0; i<6; i++)
  1920.         {
  1921.             if (strcmp(soft_recherche->puis_graph, soft_array[i].puis_graph)==0)
  1922.             {
  1923.                 j++;
  1924.                 hist_soft[k]=soft_array[i];
  1925.                 k++;
  1926.             }
  1927.         }
  1928.     }
  1929.     if(rep==5)
  1930.     {
  1931.         printf("Saisir la puissance processeur necessaire souhaitee\n");
  1932.         scanf("%s", soft_recherche->puis_proc);
  1933.         for(i=0; i<6; i++)
  1934.         {
  1935.             if (strcmp(soft_recherche->puis_proc, soft_array[i].puis_proc)==0)
  1936.             {
  1937.                 j++;
  1938.                 hist_soft[k]=soft_array[i];
  1939.                 k++;
  1940.             }
  1941.         }
  1942.     }
  1943.     if (j!=0) printf("Nous avons trouve %d fois votre config\n", j);
  1944.     system("PAUSE");
  1945.     demande_soft(hist_soft, soft_recherche, nv_soft, k+1);
  1946. }
  1947.  
  1948. int main(){
  1949.     system("mode con lines=45 cols=180");
  1950.  
  1951.     int sz_proco=8;
  1952.     int sz_graphic=6;
  1953.     int sz_motherboard=10;
  1954.     int sz_soft=6;
  1955.     int sz_hdd=9;
  1956.     int sz_ram=18;
  1957.     int sz_ecran=9;
  1958.  
  1959.     processeur proco_array[11];
  1960.     Ram ram_array[18];
  1961.     Motherboard motherboard_array[10];
  1962.     Graphics graphic_array[6];
  1963.     Soft soft_array[6];
  1964.     caracEcran ecran_array[9];
  1965.     Hdd hdd_array[9];
  1966.  
  1967.     processeur proco_recherche;
  1968.     Ram ram_recherche;
  1969.     Motherboard motherboard_recherche;
  1970.     Graphics graphic_recherche;
  1971.     Soft soft_recherche;
  1972.     caracEcran ecran_recherche;
  1973.     Hdd hdd_recherche;
  1974.  
  1975.     Soft hist_soft[6];
  1976.     processeur hist_proco[11];
  1977.     Ram hist_ram[18];
  1978.     Graphics hist_graphic[6];
  1979.     Motherboard hist_motherboard[10];
  1980.     Hdd hist_hdd[9];
  1981.     caracEcran hist_ecran[9];
  1982.  
  1983.     int choix;
  1984.     do
  1985.     {
  1986.         system("cls");
  1987.         printf("Bienvenue dans l'outil de comparaison de componsants informatiques\n");
  1988.         printf("Nous proposons de nombreux composants, faites donc vos choix et remplissez uniquement les categories si vous connaissez les references \n");
  1989.         printf("Veuillez choisir parmis la liste de composants suivants : \n");
  1990.         printf("1) Carte mere\n");
  1991.         printf("2) Processeur\n");
  1992.         printf("3) RAM\n");
  1993.         printf("4) Carte Graphique\n");
  1994.         printf("5) Disque Dur\n");
  1995.         printf("6) Ecran\n");
  1996.         printf("7) Logiciel\n\n");
  1997.         printf("0) Quitter\n\n");
  1998.         scanf("%d", &choix);
  1999.  
  2000.         switch(choix)
  2001.         {
  2002.         case 1:
  2003.             ouverture_motherboard(motherboard_array);
  2004.             demande_motherboard(motherboard_array, &motherboard_recherche, hist_motherboard, sz_motherboard);
  2005.             break;
  2006.         case 2:
  2007.             ouverture_proco(proco_array);
  2008.             demande_proco(proco_array, &proco_recherche, hist_proco, sz_proco);
  2009.             break;
  2010.         case 3:
  2011.             ouverture_ram(ram_array);
  2012.             demande_ram(ram_array, &ram_recherche, hist_ram, sz_ram);
  2013.             break;
  2014.         case 4:
  2015.             ouverture_graphics(graphic_array);
  2016.             demande_graphics(graphic_array, &graphic_recherche, hist_graphic, sz_graphic);
  2017.             break;
  2018.         case 5:
  2019.             ouverture_hdd(hdd_array);
  2020.             demande_hdd(hdd_array, &hdd_recherche, hist_hdd, sz_hdd);
  2021.             break;
  2022.         case 6:
  2023.             ouverture_Ecran(ecran_array);
  2024.             demande_ecran(ecran_array, &ecran_recherche, hist_ecran, sz_ecran);
  2025.             break;
  2026.         case 7:
  2027.             ouverture_soft(soft_array);
  2028.             demande_soft(soft_array, &soft_recherche, hist_soft, sz_soft);
  2029.             break;
  2030.         default:
  2031.             if(choix!=0) {printf("Recommencez, ce choix n'est pas disponible (pas encore!)\n"); system("PAUSE");}
  2032.             break;
  2033.         }
  2034.     }
  2035.     while (choix!=0);
  2036.     return 0;
  2037. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement