Codevs 1389 Product Average

Source: Internet
Author: User

1389 product Average Title Description Description

The product average of the number of n is defined as the product of the n number of n-th square.
Given n positive integers, the product average of the products is obtained.

Given n positive integers, the product average of the products is obtained.

Enter a description input Description

First line, a number n
Next line n number, indicating the given n number

outputs description output Description

A real number that represents the product average of the given numbers, preserving the 2-bit fractional output

sample input to sample

2
2 8

Sample output Sample outputs

4.00

data size & Hint

For 100% of data, n≤100000, each number is a positive integer and no more than 10

#include <cstdio>#include<cmath>using namespacestd;Doublen,x,s=1;intMain () {Doublei; scanf ("%LF",&N);  for(i=1; i<=n;i++) scanf ("%LF", &x), S*=pow (x,1/n);//The pow () can still use it .printf"%0.2LF", s); return 0;}

Codevs 1389 Product Average

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.