上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
摘要: (1)宏定义1.不带参数的宏定义用一个宏名代替一个字符串,只进行简单的代换,不进行任何计算,也不进行正确性检查,双引号内的宏名不进行代换,宏名一般用大写表示。#define PI 3.1415926#define定义有效范围是定义处到源文件结束,通常写在文件开头,函数前,在此文件内有效。#define PI 3.1415926int main(){return 0;}int main(){#define PI 3.1415926return 0;}可以用#undef命令结束作用域。#define PI 3.1415926int main(){return 0;}#undef PI进行宏定义时, 阅读全文
posted @ 2011-12-19 19:58 xxx1 阅读(181) 评论(0) 推荐(0)
摘要: 1.文件与目录管理(1)pwd -P 显示当前路径。(2)mkdir 新建目录参数:-m:配置权限 例 mkdir -m 711 test-p:递归创建 例 mkdir -p a/b/c(3)rmdir参数:-p:递归删除空目录 例:rmdir a/b/c(4)rm例子:rm -r a 递归删非空目录(5)cp 复制命令-i:覆盖确认-p:连同文件属性一起复制-r:递归-u:destination比source旧才更新destination的文件-d:若为链接文件则复制链接文件非文件本身-a:等价于-pdr完整复制 eg:cp ~/.bashrc ~/.bash_history /tmp .. 阅读全文
posted @ 2011-12-18 00:00 xxx1 阅读(189) 评论(0) 推荐(0)
摘要: 1.显示目前终端支持的语言2.修改LANGLANG=en_us//注意无空格3.Ctrl+d:终端输入结束4.man帮助命令标示含义执行man date 后出现如下图示:DATE(1)代号:1:用户在shell环境中可操作的命令或可执行文件。5:配置文件或某些文件格式。8:系统管理员可使用的管理命令。man帮助页大致分成下面几个部分:NAMESYNOPSIS:简短命令执行语法简介。DESCRIPTION:对命令完整的描述。OPTIONS:列举所有可用选项说明。COMMANDS:当这个程序在执行时,可以在此程序中下达指令。FILES:这个程序或数据所使用或单靠或连接到的某些档案。SEE ALSO 阅读全文
posted @ 2011-12-16 13:04 xxx1 阅读(177) 评论(0) 推荐(0)
摘要: #include "mystack.h" #include <iostream> using namespace std; char get_command() { char command; bool waiting = true; cout << "Select command and press <ENTER> : "; while (waiting){ cin >> command; if (command == '?' || command == '=' || co 阅读全文
posted @ 2011-12-13 23:14 xxx1 阅读(187) 评论(0) 推荐(0)
摘要: //Node.h typedef int Node_entry; typedef int Node_entry; enum Error_code {success, overflow, underflow, rangeError}; template <class Node_entry> struct Node { Node_entry entry; Node<Node_entry> *next; Node(); Node(Node_entry item, Node<Node_entry> *link = NULL); }; template <cla 阅读全文
posted @ 2011-12-13 23:12 xxx1 阅读(799) 评论(0) 推荐(0)
摘要: Linear Cellular AutomataA biologist is experimenting with DNA modification of bacterial colonies being grown in a linear array of culture dishes. By changing the DNA, he is able ``program" the bacteria to respond to the population density of the neighboring dishes. Population is measured on a f 阅读全文
posted @ 2011-12-03 01:08 xxx1 阅读(189) 评论(0) 推荐(0)
摘要: 利用SqlConnection对象连接sql2000以上版本,并使用SqlCommand对象对数据库进行读取。SqlCommand类概述: 用于对sql数据库执行sql语句或存储过程。 命名空间:System.Data.SqlClient 程序集: System.Data(在 System.Data.dll中)SqlCommand类的属性1.CommandText 获取或设置要对数据源执行的Transact—SQL语句或存储过程。2. CommandType获取或设置一个值,该值指示如何解释CommandText属性,CommandType默认为CommandType.Text,表示执行... 阅读全文
posted @ 2011-12-01 21:05 xxx1 阅读(447) 评论(1) 推荐(0)
摘要: 使用OleDBCommand相关操作类需要引入System.Data.OleDb命名空间。通过连接一个带密码的access数据库 读取其中的数据并置入表格中显示,验证连接和命令使用正确性。using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.OleDb; public partial class _Default : System.We. 阅读全文
posted @ 2011-12-01 17:05 xxx1 阅读(266) 评论(0) 推荐(0)
摘要: 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)
上一页 1 ··· 3 4 5 6 7 8 9 10 下一页