11 2011 档案

摘要: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 阅读(198) 评论(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 阅读(207) 评论(0) 推荐(0)
摘要:MFC ADO使用1.导入ADO链接库#import "C:/Program Files/Common Files/System/ado/msado15.dll"no_namespace rename("EOF", "adoEOF")rename("BOF", "adoBOF")//两行写一行,写在stdafx.h文件末尾 。C为系统盘。2.ADO封装工程中引入以下两文件。view plain//ADO.h#pragmaonceclassADO{public:ADO(void);~ADO(voi 阅读全文
posted @ 2011-11-28 22:08 xxx1 阅读(329) 评论(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-11-28 17:24 xxx1 阅读(233) 评论(0) 推荐(0)
摘要:Marvelous MazesYour mission, if you decide to accept it, is to create a maze drawing program. A maze will consist of the alphabetic charactersA-Z,*(asterisk), and spaces.Input and OutputYour program will get the information for the mazes from the input file. This file will contain lines of character 阅读全文
posted @ 2011-11-28 01:03 xxx1 阅读(427) 评论(0) 推荐(0)
摘要:Rotating SentencesIn ``Rotating Sentences,'' you are asked to rotate a series of input sentences 90 degrees clockwise. So instead of displaying the input sentences from left to right and top to bottom, your program will display them from top to bottom and right to left.Input and OutputAs inp 阅读全文
posted @ 2011-11-24 23:57 xxx1 阅读(223) 评论(0) 推荐(0)
摘要:Machined SurfacesAn imaging device furnishes digital images of two machined surfaces that eventually will be assembled in contact with each other. The roughness of this final contact is to be estimated.A digital image is composed of the two characters,"X"and" "(space). There are 阅读全文
posted @ 2011-11-24 22:26 xxx1 阅读(60933) 评论(0) 推荐(0)
摘要:Kindergarten Counting GameEverybody sit down in a circle. Ok. Listen to me carefully.``Woooooo, you scwewy wabbit!''Now, could someone tell me how many words I just said?Input and OutputInput to your program will consist of a series of lines, each line containing multiple words (at least one 阅读全文
posted @ 2011-11-23 20:24 xxx1 阅读(188) 评论(0) 推荐(0)
摘要:The DecoderWrite a complete program that will correctly decode a set of characters into a valid message. Your program should read a given file of a simple coded set of characters and print the exact message that the characters contain. The code key for this simple coding is a one for one character s 阅读全文
posted @ 2011-11-23 18:55 xxx1 阅读(165) 评论(0) 推荐(0)
摘要:Linux基本常用知识整理Linux启动过程1.BIOS自检。2.启动Grub。3.运行Linux内核并检测硬件。4.运行系统第一个进程init。5.init读取系统引导配置文件/etc/inittab中的信息进行初始化。6./etc/rc.d/rc.sysinit 系统初始化脚本。7./etc/rc.d/rcx.d/[ks]* 根据运行级别x配置服务。a)终止以”k”开头服务。b)启动以”s”开头的服务。8./etc/rc.d/rc.local 执行本地特殊服务。9. 其他特殊服务。 Linux指定运行级别 命令:#/sbin/init [0123456] runlevel :查看当前用户. 阅读全文
posted @ 2011-11-21 23:31 xxx1 阅读(223) 评论(0) 推荐(0)
摘要:Problem AEcological PremiumInput:standard inputOutput:standard outputTime Limit:1 secondMemory Limit:32 MBGerman 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 an 阅读全文
posted @ 2011-11-21 18:08 xxx1 阅读(194) 评论(0) 推荐(0)
摘要:Back to High School PhysicsInput:standard inputOutput:standard outputA 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 阅读全文
posted @ 2011-11-20 22:16 xxx1 阅读(177) 评论(0) 推荐(0)
摘要:Hashmat the brave warriorInput:standard inputOutput:standard outputHashmat 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& 阅读全文
posted @ 2011-11-20 21:28 xxx1 阅读(199) 评论(0) 推荐(0)
摘要:stack应用#include <iostream> #include <cmath> #include <stack> #define max 3005 using namespace std; int t[max]; stack<int> a; void clear() { while (!a.empty()) a.pop(); } int main() { int n; while (cin >> n) { int sub, tmp, flag = 1; for (int i = 1;... 阅读全文
posted @ 2011-11-16 23:30 xxx1 阅读(186) 评论(0) 推荐(0)
摘要:Problem C: WERTYUA common typing error is to place the hands on the keyboard one row to the right of the correct position. So "Q" is typed as "W" and "J" is typed as "K" and so on. You are to decode a message typed in this manner.Input consists of several line 阅读全文
posted @ 2011-11-14 19:30 xxx1 阅读(295) 评论(0) 推荐(0)