Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <time.h>
- #include<windows.h>
- using namespace std;
- int main()
- {
- double stop, start;
- start =clock();
- cout << "Losowanie liczb!" << endl;
- double liczba;
- srand(time(NULL));
- liczba= 2+ (double)rand()/RAND_MAX*8;
- cout<<"\a"<<liczba<<endl<<endl;
- int a=0;
- while(a<=100)
- {
- cout<<a<<endl;
- a++;
- }
- Sleep(2000);
- cout<<endl;
- stop=clock();
- double wynik=(stop-start)/CLOCKS_PER_SEC;
- cout<<"Czas to: "<<wynik<<endl<<endl;;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement