-->
当前位置:首页 > 题库

PROGRAMMING:Mean value of rational number

Luz5年前 (2021-05-10)题库401
This problem requires programming to calculate the average value of N rational numbers.
###Input format:
Enter the first line to give a positive integer n ($$$Le $$100); In the second line, n rational numbers in fractional form are given according to the format of 'A1 / B1, A2 / B2...', in which the numerator and denominator are all integers in the range of shaping; If it is a negative number, the negative sign must appear at the front.
###Output format:
Output the average value of N rational numbers in a row according to the format of 'A / B'. Note that it must be the simplest fractional form of the rational number. If the denominator is 1, only the numerator will be output.
###Input sample 1:
```in
four
1/2 1/6 3/6 -5/10
```
###Output sample 1:
```out
1/6
```
###Input example 2:
```
two
4/3 2/3
```
###Output example 2:
```
one
```






answer:If there is no answer, please comment