题目大意:
输入一个文章,[ 就是把光标放到最前面 ] 把光标放到最后面。
输出最后得到的文章。
思路分析:
用deque 模拟。
#include
#include
#include
#include
#define maxn 111111
using namespace std;
char str[maxn];
deque Q;
deque::itera...
分类:
其他好文 时间:
2014-05-23 08:12:11
阅读次数:
335
在 Linux 内核代码,特别是驱动代码中经常见到的用法是使用一个标准结构,后面的代码基于这个结构来实现,类似面向对象的多态特性。
在 C 语言里面借助结构体和函数指针实现的这个功能,这里我们写了个例子,提取了关键代码:
#include
struct s_new{
char name[10];
char* (* my_method)(char *name);...
分类:
系统相关 时间:
2014-05-23 07:58:18
阅读次数:
324
#include
//#include
using namespace std;
struct node
{
char word[10];
int num;
};
node obj[100];
void my_word(char input[], char output[])
{
int sum=0,flag=0;...
分类:
其他好文 时间:
2014-05-22 12:41:25
阅读次数:
233
#include
#include
struct test
{
char name[20];
void (*func)(char *);
};
void tttfunc(char *name)
{
printf("current is %d\n",__LINE__);
printf("%s\n",name);
}
int main()
{
struct test ttt=
{
.n...
分类:
系统相关 时间:
2014-05-22 11:25:09
阅读次数:
380
#include
void main(){
const int count = 5;//定义数量
struct student{
char name[80];
float math,eng;
float aver;
}stu[count],temp;
//输入
for (int i = 0; i
scanf("%s%f%f", stu[i].name, &stu[i].m...
分类:
编程语言 时间:
2014-05-22 11:21:15
阅读次数:
312
1,什么是类的拷贝控制
当我们定义一个类的时候,为了让我们定义的类类型像内置类型(char,int,double等)一样好用,我们通常需要考下面几件事:
Q1:用这个类的对象去初始化另一个同类型的对象。
Q2:将这个类的对象赋值给另一个同类型的对象。
Q3:让这个类的对象有生命周期,比如局部对象在代码部结束的时候,需要销毁这个对象。
因此C++就定义了5种拷贝控制操作...
分类:
编程语言 时间:
2014-05-22 09:08:59
阅读次数:
347
#include//中缀表达式求值
#include
using namespace std;
int precede(char t1,char t2) //shuru//判断优先级
{
int t=0;
switch(t2)
{
case '+':
case '-':
if(t1=='(...
分类:
其他好文 时间:
2014-05-22 07:48:44
阅读次数:
237
DWORD WINAPI mythread( LPVOID lpParameter) //客户线程{ struct My my; memcpy(&my,lpParameter,sizeof(My)); printf("One client connect!\n"); char str1; ......
分类:
其他好文 时间:
2014-05-22 06:31:02
阅读次数:
319
1. 文件的打开读写 关闭
int open(const char *pathname,int flag,…) 打开一个文件
成功则返回文件描述符,若出现则返回-1
flag可以取下面的常量
O_RDONLY 只读打开
O_WRONLY 只写打开
O_RDWR 读写打开
其它的常量 O_APPEND,O_CREAT,O_EXCL,O_TRUNC,O_NOCTT...
分类:
其他好文 时间:
2014-05-20 16:07:29
阅读次数:
269
六、鉴别器 在"一棵对象继承树对应一个表"的策略中,元素是必需的, 它定义了表的鉴别器字段。
鉴别器字段包含标志值,用于告知持久化层应该为某个特定的行创建哪一个子类的实例。
如下这些受到限制的类型可以使用:String,Char,Int32,Byte,Short,Boolean,YesNo,Tru....
分类:
系统相关 时间:
2014-05-20 08:18:05
阅读次数:
703