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