摘要: BackgroundMcCarthy is a famous theorician of computer science. In his work, he defined a recursive function, called f91, that takes as input a positive integerNand returns a positive integer defined as follows:IfN ≤ 100, then f91(N) = f91(f91(N+11));IfN ≥ 101, then f91(N) =N-10.The ProblemWrite a pr 阅读全文
posted @ 2013-02-25 21:33 刘一卜 阅读(551) 评论(0) 推荐(0)
摘要: Someoperatorschecks about the relationship between two values and these operators are called relational operators. Given two numerical values your job is just to find out the relationship between them that is (i) First one is greater than the second (ii) First one is less than the second or (iii) Fi 阅读全文
posted @ 2013-02-25 21:30 刘一卜 阅读(242) 评论(0) 推荐(0)
摘要: It is said that 90% of frosh expect to be above average in their class. You are to provide a reality check.The first line of standard input contains an integer C, the number of test cases. C data sets follow. Each data set begins with an integer, N, the number of people in the class (1 <= N <= 阅读全文
posted @ 2013-02-25 21:27 刘一卜 阅读(332) 评论(0) 推荐(0)
摘要: 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 T tes 阅读全文
posted @ 2013-02-25 21:24 刘一卜 阅读(232) 评论(0) 推荐(0)
摘要: German farmers are given a premium depending on the conditions at their farmyard. Imagine the following simplified regulation: you know the size of each farmer's farmyard in square meters and the number of animals living at it. We won't make a difference between different animals, although t 阅读全文
posted @ 2013-02-25 21:21 刘一卜 阅读(244) 评论(0) 推荐(0)
摘要: A particle has initial velocity and constant acceleration. If its velocity after certain time is v then what will its displacement be in twice of that time?InputThe input will contain two integers in each line. Each line makes one set of input. These two integers denote the value of v (-100 <= v 阅读全文
posted @ 2013-02-25 21:17 刘一卜 阅读(297) 评论(0) 推荐(0)
摘要: Hashmat is a brave warrior who with his group of young soldiers moves from one place to another to fight against his opponents. Before fighting he just calculates one thing, the difference between his soldier number and the opponent's soldier number. From this difference he decides whether to fi 阅读全文
posted @ 2013-02-25 21:14 刘一卜 阅读(418) 评论(0) 推荐(0)