Advertisement
naskedvi

S1 - zad.22.

Mar 2nd, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. int n, a;
  6. float s1=0, s2=0;
  7. std:: cin >> n;
  8. for(int i=1; i<=n; i++)
  9. {
  10. std:: cin >> a;
  11. s1=s1+a;
  12. s2=s2+(1/s1);
  13. }
  14. std:: cout << "Suma je: " << s2;
  15.  
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement