Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <time.h>
- #include <cstdlib>
- using namespace std;
- int ile;
- clock_t start, stop;
- double czas;
- int main()
- {
- cout << "Ile liczb w tablicy: ";
- cin>>ile;
- int *tablica;
- tablica= new int [ile];
- int *wskaznik=tablica;
- start=clock();
- for (int i=0; i<ile; i++)
- {
- *wskaznik=i;
- *wskaznik+=50;
- wskaznik++;
- }
- stop= clock();
- czas=(double)(stop - start)/CLOCKS_PER_SEC;
- cout<<"Czas zapisu (ze wskaznikiem): "<<czas;
- delete [] tablica;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement