Advertisement
Guest User

zadanie 22

a guest
Nov 12th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.  int a,b=0;
  11. srand( time( NULL ) );
  12.  
  13.  for(int i=0;i<99;i++)
  14.  {
  15.  
  16.  
  17.  a=(rand()%16+20);
  18.  cout<<a<<endl;
  19.  if(a>32)
  20.     {
  21.     b++;
  22.  
  23.  
  24.  }
  25.  }
  26.  
  27. cout<<"Wylosowano "<<b<<" liczb wiekszych od 32";
  28.  
  29.  
  30.  
  31.  
  32.  
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement