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
| #include <cstdlib>
#include <iostream>
#include <stdlib.h>
#include <ctime>
using namespace std;
int main(int argc, char *argv[])
{
double tab1 [6] [4];
const unsigned amorce = time(NULL);
int max, min, plage;
double tab2 [10] [2]= {0};
int compteur = 0;
int chiffre[10]= {0,1,2,3,4,5,6,7,8,9};
int m =0;
int i=0;
cout << " Entrez la valeur min: "<< endl;
cin >> min;
cout << " Entrez la valeur max: "<< endl;
cin >> max;
plage = max-min + 1;
srand ( amorce );
cout << "Generer des entiers compris entre " <<min << " et "<< max<< endl;
for ( int i=0; i < 4;i++)
{ for ( int j=0; j< 6; j++)
{ tab1[i][j] = rand() %plage + min;
cout<< tab1 [i] [j] <<"\t" ; }
cout << endl; }
cout << endl;
cout <<" DETERMINATION DE LA FREQUENCE DES NOMBRES DU TABLEAU PRECEDENT "<< endl;
for ( int k = 0 ;k<10;k++)
{cout<< chiffre[k] << "\t" ;}
if (tab1[i][j] == chiffre[k])
m=m++;
cout << m << endl;
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
} |
Partager