Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,x;
- double s=0;
- cin>>n;
- for(int i=1;i<=n;++i)
- {
- cin>>x;
- s+=1.0/x;
- }
- int ma=(int)n*100/s;
- cout<<ma/100<<'.'<<ma%100<<'\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement