Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<ctime>
- #include<cstdlib>
- using namespace std;
- int main(){
- int tab[100];
- int i;
- int a[16]= {0,0,0,0,0,0,0,0,0,0,0,0,0};
- srand(time(NULL));
- for(i=0;i<100;i++)
- {
- tab[i] = rand() % 15+1;
- if(tab[i] > 16)
- cout << "error code 1, i : " <<tab[i]<< endl;
- a[tab[i]]++;
- }
- for(i=0;i<16;i++){
- cout << i+1 << " powtarza si\251:" << a[i]<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement