/*
  Name: note_moy 
  Copyright: b1_1
  Author: Archambeau
  Date: 16/09/06 18:19
  Description: donne des statistiques de différentes notes
*/
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>

int main(void)
{
    int compteur=0,
        nb_min=0,
        nb_max=0;
    
    float tot=0,
          note=0,
          note_max=0,
          note_min=20;
    
    printf("Statistiques relatives a une suite de notes\n");
    
    while (note>=0)
    {
       printf("introduisez une note: \n");
       scanf("%f", &note);
       tot=tot+note;
       compteur=compteur+1;
       if (note>=note_max)
       {
          if (note == note_max)
             nb_max++;
          else
          {
             note_max=note;
             nb_max=1;
          }
       }
       if ((note<=note_min) && (note>0))
       {   
          if (note==note_min)
             nb_min++;
          else                           
          {
             note_min=note;
             nb_min=1;   
          }
       }                  
    }
    if (compteur!=0)
    {
       tot=tot-note;
       tot=tot/(compteur-1);
       printf("note moyenne :%f\n",tot);
       printf("note min :%f\n",note_min);
       printf("nbre de note min :%d\n",nb_min);
       printf("note max :%f\n",note_max);
       printf("nbre de note max :%d\n",nb_max);
    }
    else
       printf("Aucune note valide !\n");
    
    system ("pause");
    return 0;
}
