摘要: The Collatz SequenceAn algorithm given by Lothar Collatz produces sequences of integers, and is described as follows:Step 1:Choose an arbitrary positive integerAas the first item in the sequence.Step 2:IfA= 1 then stop.Step 3:IfAis even, then replaceAbyA/ 2 and go to step 2.Step 4:IfAis odd, then re 阅读全文
posted @ 2011-11-30 22:55 xxx1 阅读(194) 评论(0) 推荐(0)
摘要: Hangman JudgeIn ``Hangman Judge,'' you are to write a program that judges a series of Hangman games. For each game, the answer to the puzzle is given as well as the guesses. Rules are the same as the classic game of hangman, and are given as follows:The contestant tries to solve to puzzle by 阅读全文
posted @ 2011-11-30 00:47 xxx1 阅读(204) 评论(0) 推荐(0)