数组实现的MyQueue顺序队列

#include<iostream> #include<cstdlib> using namespace std; typedef struct Queue { int *Array; int Front,Rear; }*MyQueue; MyQueue Create(void); //创建一个队列 int IsEmpty(MyQueue Q); //检验是否为空栈 void DeQueue(MyQueue Q); //出队 void EnQueue(int X,MyQueue Q); //入队 void GetQueueFront(MyQ...
飞机火车 发布于 2017-04-24 18:49 | 阅读 1234 次 | 评论 0 条

前端优化

一、页面js,style复用,命名规范 二、注意标签缩进 三、将页面中的图片统一进行处理,合并,再使用style引入,获取指定图片位置中的内容 <html> <head> <style> .TCLogo { width:146px; height:36px; background-image:url(原图.png); background-attachment:fixed; background-position:-100px -87px; background-repeat:no-repeat; } ...
mooncharmzx 发布于 2017-04-24 10:43 | 阅读 1790 次 | 评论 0 条

链表实现的MyQueue顺序队列

#include<iostream> #include<cstdlib> #define MAXSIZE 100 using namespace std; typedef struct Node { struct Node *Next; //队列元素的节点连接 int Element; }MyNode; typedef struct Queue { Node *Front; //Front和Rear连接着各自应有的节点 Node *Rear; int Items; //队列元素的个数,用于判断是否空队列,...
飞机火车 发布于 2017-04-23 09:44 | 阅读 1205 次 | 评论 0 条

C/C++栈的链表实现

#include<iostream> #include<cstdlib> #define LEN sizeof(struct Node) using namespace std; struct Node; typedef struct Node *PtrToNode; typedef PtrToNode Position; struct Node //节点 { int Element ; struct Node *Next; }; int IsEmpty(Position Top); //检验空栈 void GetStackTo...
飞机火车 发布于 2017-04-22 11:03 | 阅读 1429 次 | 评论 1 条

C/C++栈的数组实现

#include<iostream> #include<cstdlib> using namespace std; int *Array=NULL; int Count=0; void Initial(int Size); //初始化栈 void Push(int Element); //入栈 int GetStackLenth(void);//获取栈的个数 void GetTopOfStack(void);//栈顶元素 void Pop(void); //出栈 void Traverse(void); //遍历 voi...
飞机火车 发布于 2017-04-22 10:54 | 阅读 1125 次 | 评论 0 条

DoubleWayList 双向循环链表

//我发现,插入操作时,总是先把New与已有节点连接 #include<iostream> #include<cstdlib> #define LEN sizeof(struct Node) using namespace std; typedef struct Node *PtrToNode; typedef PtrToNode Position; struct Node { int Element; struct Node *Last; struct Node *Next; }; Position Create(void); ...
飞机火车 发布于 2017-04-20 20:26 | 阅读 1325 次 | 评论 0 条

浅谈字符串比较

前一段时间自己想写几行代码,所以就有了以下的代码: public class TestString_1 { public static void main(String[] args) { String str1="this is test"; String str2="this is test"; String str3=new String("this is test"); String str4=new String("this is test"); System...
蓝神100 发布于 2017-04-18 15:00 | 阅读 945 次 | 评论 0 条

代码不再同步bccn。谢谢关注

考虑到代码的维护性。代码不在发布在blog里面。已经托管github 。谢谢关注
s912360101 发布于 2017-04-17 17:07 | 阅读 1135 次 | 评论 0 条

SingleCycleList单向循环链表

#include<iostream> #include<cstdlib> using namespace std; #define LEN sizeof(struct Node) #define N 6 typedef struct Node *PtrToNode; typedef PtrToNode Position; struct Node { int Element; struct Node *Next; }; Position Create(void); //创建一个循环链表 void Taverse(Position Hea...
飞机火车 发布于 2017-04-17 12:55 | 阅读 1465 次 | 评论 0 条

VC++ 6.0+matlab

在matlab中怎样用mcc将.m文件编译成可执行的c++文件
p15538191150 发布于 2017-04-17 10:37 | 阅读 596 次 | 评论 0 条

求一个3×3的整型矩阵正对角线元素之和。

#include<stdio.h> int main() { int i,j,sum=0; int a[3][3]={{1,2,3},{4,5,6},{7,8,9}}; for(i=0;i<3;i++) for(j=0;j<3;j++) if(i==j) sum=sum+a[i][j]; printf("a:\n"); for(i=0;i<3;i++) { for(j=0;j<3;j++) printf("%d",a[i][j]); printf("\n"); } printf("sum is %d\n",sum); return 0; }
洛水轻尘 发布于 2017-04-15 11:32 | 阅读 1246 次 | 评论 0 条

有15个数按由大到小顺序存放在一个数组中,输入一个数,要求用折半查找法找出该数组数组中第几个元素的值。如果该数不存在数组中,则输出“无此数”。

#include<stdio.h> int main() { int t[15]={15,14,13,12,11,10,9,8,7,6,5,4,3,2,1}; int a,b,c,mid; int i; a=0;b=14; printf("the array is:\n"); for(i=0;i<15;i++) printf("%d",t[i]); printf("\n"); printf("please input the number:"); scanf("%d",&amp;c); while(a<=b) { mid=(a+b)/2; if(c==t[...
洛水轻尘 发布于 2017-04-15 11:17 | 阅读 1325 次 | 评论 0 条

编一程序,将两个字符串连接起来,不要用strcat函数。

#include<stdio.h> int main() { char a[30]="I am a boy.",b[]="I am a student."; int i=0,j; j=strlen(a); printf("a is:%s\n",a); printf("b is:%s\n",b); while(b[i]!='\0') { a[j]=b[i]; i++; j++; } a[j]='\0'; printf("%s\n",a); return 0; }
洛水轻尘 发布于 2017-04-15 10:59 | 阅读 1575 次 | 评论 0 条

c日记

最简单的结构体定义、输出 #include<stdio.h> struct Date { int month; int day; int year; }birthday; struct Student { int num; char name[20]; char sex; int age; float score; char addr[30]; struct Date birthday; }a={102,"zhang...
shuanggege 发布于 2017-04-13 21:51 | 阅读 807 次 | 评论 0 条

SingleList单链表

#include<stdio.h> #include<stdlib.h> #include<malloc.h> struct Node; typedef struct Node *PtrToNode; //typedef PtrToNode List; typedef PtrToNode Position; struct Node { int Element; //元素 //int Subscrit; //下标 struct Node *Next; }; Position Create(void); //创建链表 void ...
飞机火车 发布于 2017-04-11 17:29 | 阅读 2830 次 | 评论 0 条

SVN 查看最后的更新文件列表

svn windows工具是可以方便的查看最近改动的文件的 Linux mac下经常更新以后,忘记哪些文件是最近修改的。 命令格式如下: svn diff -r REVNO:HEAD --summarize http://svn-url 例如 想检查从 724版本 开始到目前所有改动文件的列表 svn diff -r 724:HEAD –summarize https://192.168.198.2/svn > changedfiles.txt 可以简写成这样 svn diff -r 724 ...
yuexiaosheng 发布于 2017-04-11 12:38 | 阅读 6844 次 | 评论 0 条

利用中断控制秒表的开关

#include <reg52.h> typedef unsigned int U16; typedef unsigned char U8; U8 num[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x7F,0xFF}; sbit LED0=P1^0; sbit LED1=P1^1; sbit LED2=P1^2; sbit LED3=P1^3; sbit KeyIn4=P3^4; U8 shuma[4]={0}; void delay() { U16 i=1000; whil...
gyjgyjgyj 发布于 2017-04-11 09:15 | 阅读 950 次 | 评论 0 条

单片机 两个按键分别控制

#include<reg52.h> typedef unsigned char U8; typedef unsigned int U16; U16 x=0; sbit S1 = P3^6; sbit S2 = P3^7; sbit led0=P1^3; sbit led1=P1^2; sbit led2=P1^1; sbit led3=P1^0; code U8 num[]={0xC0,0xF9,0xA4,0xB0,0x99, 0x92,0x82,0xF8,0x80,0x90}; U8 shuma[4]={0}; void delay() { ...
gyjgyjgyj 发布于 2017-04-11 09:14 | 阅读 810 次 | 评论 0 条

利用中断实现十进制

#include <reg52.h> typedef unsigned int U16; typedef unsigned char U8; U8 num[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x7f,0xFF}; sbit LED3=P1^3; sbit LED2=P1^2; sbit LED1=P1^1; sbit LED0=P1^0; U8 shuma[4]={0}; void T0_Init() { TMOD=0x10; TH1=0xFC; TL1=0x18; TR1=1...
gyjgyjgyj 发布于 2017-04-11 09:13 | 阅读 701 次 | 评论 0 条

倒计时

#include <reg52.h> #include <reg52.h> typedef unsigned int U16; typedef unsigned char U8; U8 num[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92, 0x82,0xF8,0x80,0x90,0x7f,0xFF}; sbit LED3=P1^3; sbit LED2=P1^2; sbit LED1...
gyjgyjgyj 发布于 2017-04-11 09:12 | 阅读 681 次 | 评论 0 条