Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int n, composition = 1;
- float count_ = 0;
- int check = scanf("%d", &n);
- if (n > 0 && n < 11 && check == 1)
- {
- int x[n];
- for (int i = 1; i <= n; i++)
- {
- int check_2 = scanf("%d", &x[i]);
- if (check_2 != 1)
- { return 1; }
- if (x[i] > 0)
- {
- composition = composition * x[i];
- count_++;
- }
- }
- printf("%f", pow(composition, (1 / count_)));
- return 0;
- }
- else
- { return 1; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement