Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- const int n=5;
- int a[n]={1,5,2,7,2},i;
- double sum,s;
- sum=0;
- s=0;
- for (i=0;i<n;i++)
- sum=1/((double)a[i])+sum;
- s=n/sum;
- cout<<"s="<<s<<endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment