Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <time.h>
- #include <windows.h>
- using namespace std;
- int l(void )
- {
- return rand()%99+1;
- }
- int main()
- {
- //napisz program losujący liczbę od 1-100 i ma byćwywoływana 10 razy w i liczy i wylosowane liczby parzyste
- srand(time(NULL));
- int p=0;
- for (int i=0;i<=10;i++)
- {
- Beep(l()*100,100);
- cout<<l()<<endl;
- if(l()%2==0)
- {
- p++;
- }
- }
- cout<<"Parzyste: "<<p;
- Beep(p*20,150);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement