#include <iostream>

using namespace std;

const int Nmax = 100;

void Saisie(int tab[], int &n, int &S, float &Moy);
void Affichage(int tab[], int n, int S, float Moy);

void main()
{
    int N, S;
    float Moy;
    int Tab[Nmax];

    Saisie(Tab, N, S, Moy);
    Affichage(Tab, N, S, Moy);
}

void Saisie(int tab[], int &n, int &S, float &Moy)
{
    cout << "Entrez la taille du tableau : ";
    cin >> n;

    if (n > Nmax)
    {
        n = Nmax;
        cout << "La taille maximale du tableau est de " << Nmax;
    }

    S = 0;

    for (int i = 0; i < n; i++)
    {
        cout << "tab[" << i << "]" << " = ";
        cin >> tab[i];
        S += tab[i];
    }

    Moy = S / (float)n;
}

void Affichage(int tab[], int n, int S, float Moy)
{
    for (int i = 0; i < n; i++)
    {
        cout << "tab[" << i << "]" << " = " << tab[i] << endl;
    }

    cout << "Somme = " << S << endl;
    cout << "Moyenne = " << Moy << endl;
}