SHARE
TWEET

Untitled

a guest May 22nd, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <time.h>
  3. #include <cstdlib>
  4. using namespace std;
  5.  
  6. int main() {
  7. srand(time(0));
  8. int liczba[21], wyst[6];
  9. for (int i=0; i<6;i++) wyst[i]=0;
  10. for (int i=0; i<21;i++){
  11.     liczba[i] = rand()%(7-2+1)+2;
  12.     cout<<liczba[i]<<endl;
  13.     wyst[liczba[i]-2]++;
  14.    
  15. }
  16. for(int i=0;i<=7-2;i++){
  17.     cout<<"liczba "<<2+i<<" wystapila "<<wyst[i]<<" razy\n";
  18. }
  19.  
  20.     return 0;
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top