题目如下: Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum. Input Specification: Each input file contains one test case. Each case starts with a positive integer N (<=100), followed in the next…
题目 Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum. Input Specification: Each input file contains one test case. Each case starts with a positive integer N (<=100), followed in the next li…
the problem is from PAT,which website is http://pat.zju.edu.cn/contests/pat-a-practise/1081 the code is as followed: #include<stdio.h> #include<math.h> long int gongyue(long int num1, long int num2) { ; if (num1==num2) { gcd = num1; } if (num1…
1081 Rational Sum (20 分) Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum. Input Specification: Each input file contains one test case. Each case starts with a positive integer N (≤), followed in t…
1081. Rational Sum (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum. Input Specification: Each input file contains one…
1081 Rational Sum (20 分) Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum. Input Specification: Each input file contains one test case. Each case starts with a positive integer N (≤100), followed in…
Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum. Input Specification: Each input file contains one test case. Each case starts with a positive integer N (≤), followed in the next line N rational num…