摘要: #include #include #include #include #include using namespace std;#define MAX 100char* add_func(char *a,char*b){ int num1 = strlen(a); int num2 = strl... 阅读全文
posted @ 2015-06-09 04:24 无辜的小明 阅读(159) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std;#define n 5struct A{ int data;//记录会场的时间 int flag; //为0代表开始时间,为1代表结束时间};int main(){ int i = 0; A a[2*n];... 阅读全文
posted @ 2015-06-09 00:39 无辜的小明 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 1基本解释:extern可以置于变量或者函数前,以标示变量或者函数的定义在别的文件中,提示编译器遇到此变量和函数时在其他模块中寻找其定义。此外extern也可用来进行链接指定。也就是说extern有两个作用.第一,当它与"C"一起连用时,如: extern "C" void fun(int a, i... 阅读全文
posted @ 2015-06-08 15:14 无辜的小明 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 2个栈S1,S2S1用来接收或者删除终端输入的数据,直到输入换行命令将S1的数据全部转入S2中将S2的数据写入数据区 阅读全文
posted @ 2015-05-28 22:43 无辜的小明 阅读(124) 评论(0) 推荐(0) 编辑
摘要: /*十进制转八进制*/#include #include #include using namespace std;#define SIZE 300struct Cstruct{int *base; //用来指向栈底int *top; //用来指向栈顶int size; //用来初始化栈的大小Cst... 阅读全文
posted @ 2015-05-28 22:21 无辜的小明 阅读(155) 评论(0) 推荐(0) 编辑
摘要: /*编程实现当输入2006年1月1日之后的任意一天距离起始日期和输入日期的天数*/#include#includeint days(int year,int month,int day )//不考虑平年闰年{ int count=0; int year_month[]={31,28,31,30,31... 阅读全文
posted @ 2015-05-27 17:17 无辜的小明 阅读(408) 评论(0) 推荐(0) 编辑
摘要: /*输入一英文句子,将其中所有单词首字符转换成大写后输出*/#include#includechar *toupper(char *str){ char *p=str; int len=strlen(str);if(*p==' ') //消除前面空格 { p++; len--; } if(*p>... 阅读全文
posted @ 2015-05-26 14:21 无辜的小明 阅读(260) 评论(0) 推荐(0) 编辑