Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- const int sizee=50;
- double a[sizee]={0.}
- double *p1,*p2,*p3,*p4,sum=0,average;
- p1=&average;
- p2=∑
- p3=a;
- for int(i=0;i<sizee;i++){
- a[i]=1/(i+1.);
- *p2+=*(p3+i);
- }
- *p1=*p2/sizee;
- cout << "average" << *p1<< endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement