Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- using namespace std;
- int main(int argc, char** argv)
- {
- cout<<"Podaj wielkosc tablicy : ";
- int n;
- cin>>n;
- double x=0.1;
- int *a;
- a = new int [n];
- int v=0;
- long double start=clock();
- for (int i=n; i>=0; i--){
- v=+a[i]+v*x;
- }
- long double stop=clock();
- long double czas = double(stop-start)/CLOCKS_PER_SEC;
- cout<<"Wynik to = "<< v<<endl<<"czas to= "<<czas<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement