摘要: 1081 Rational Sum (20)(20 分) Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum. Input Specificatio 阅读全文
posted @ 2018-06-04 23:37 Cirno-9 阅读(113) 评论(0) 推荐(0) 编辑
摘要: int gcd(int a, int b) { if (b == 0) return 0; else return gcd(b, a % b); } struct Fraction { int up, down; }; Fraction Reduction(Fraction result) { if (result.down r.down) { ... 阅读全文
posted @ 2018-06-03 23:48 Cirno-9 阅读(366) 评论(0) 推荐(0) 编辑
摘要: 其他方法参考: http://www.cnblogs.com/asheng2016/p/7661311.html https://blog.csdn.net/xtzmm1215/article/details/38407799 阅读全文
posted @ 2018-06-01 22:04 Cirno-9 阅读(88) 评论(0) 推荐(0) 编辑