Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main () {
- float x,s=0.0;
- int n,i=1;
- cout<<"n= ";
- cin>>n;
- while (i<=n)
- {
- cout<<"nr"<<i<<'=';
- cin>>x;
- s=s+1/x;
- i++;
- }
- cout<<"media armonica e: "<<n/s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement