10783 - Odd Sum

摘要: Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is3 + 5 + 7 + 9 = 24.InputThere can be at multiple test cases. The first line of input gives you the number of test cases, T (1T100). Then 阅读全文
posted @ 2013-02-06 12:35 喂喂还债啦 阅读(899) 评论(0) 推荐(0)

10696 - f91

摘要: BackgroundMcCarthy is a famous theorician of computer science. In his work, he defined a recursive function, called f91, that takes as input a positive integer N and returns a positive integer defined as follows:If N ≤ 100, then f91(N) = f91(f91(N+11));If N ≥ 101, then f91(N) = N-10.The ProblemWrite 阅读全文
posted @ 2013-02-06 12:20 喂喂还债啦 阅读(412) 评论(0) 推荐(0)

488 - Triangle Wave

摘要: In this problem you are to generate a triangular wave form according to a specified pair of Amplitude and Frequency.Input and OutputThe input begins with a single positive integer on a line by itself indicating the number of the cases following, each of them as described below. This line is followed 阅读全文
posted @ 2013-02-06 11:04 喂喂还债啦 阅读(283) 评论(0) 推荐(0)