上一页 1 ··· 14 15 16 17 18
摘要: 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-07-22 20:44 AC_Von 阅读(228) 评论(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-07-22 19:29 AC_Von 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Triangle WaveIn 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 lin 阅读全文
posted @ 2011-07-22 16:22 AC_Von 阅读(205) 评论(0) 推荐(0) 编辑
摘要: #include <windows.h>#include <conio.h>#include <stdio.h>int main(){ char a[9]="color 0f"; int i; system("color 5"); for(i=1;i<=9;i++) { a[6]=(char)((int('0'))+i); system(a); getch(); } return 0;} 阅读全文
posted @ 2011-06-18 15:08 AC_Von 阅读(82) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18