fork download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int i;
  8. int n;
  9. double sum=0;
  10. cin>>n;
  11. double a;
  12. for(i=1;i<=n;++i)
  13. {
  14. cin>>a;
  15. sum+=sqrt(10+a*a);
  16. }
  17. cout<<sum;
  18. return 0;
  19. }
Success #stdin #stdout 0s 3472KB
stdin
6 1 0.5 7 19 -9 8
stdout
51.6024