摘要: Fractions to DecimalsWrite a program that will accept a fraction of the form N/D, where N is the numerator and D is the denominator and print the decimal representation. If the decimal representation has a repeating sequence of digits, indicate the sequence by enclosing it in brackets. For example, 阅读全文
posted @ 2012-10-07 17:47 剑不飞 阅读(219) 评论(0) 推荐(0)
摘要: Bessie Come HomeKolstad & Burch It's dinner time, and the cows are out in their separate pastures. Farmer John rings the bell so they will start walking to the barn. Your job is to figure out which one cow gets to the barn first (the supplied test data will always have exactly one fastest co 阅读全文
posted @ 2012-10-07 12:09 剑不飞 阅读(437) 评论(0) 推荐(0)
摘要: Cow ToursFarmer John has a number of pastures on his farm. Cow paths connect some pastures with certain other pastures, forming a field. But, at the present time, you can find at least two pastures that cannot be connected by any sequence of cow paths, thus partitioning Farmer John's farm into m 阅读全文
posted @ 2012-10-07 10:11 剑不飞 阅读(231) 评论(0) 推荐(0)