#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...
一、页面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;
}
...
#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; //队列元素的个数,用于判断是否空队列,...
#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...
#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...
//我发现,插入操作时,总是先把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); ...
前一段时间自己想写几行代码,所以就有了以下的代码:
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...
考虑到代码的维护性。代码不在发布在blog里面。已经托管github 。谢谢关注
#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...
在matlab中怎样用mcc将.m文件编译成可执行的c++文件
#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;
}
#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",&c);
while(a<=b)
{
mid=(a+b)/2;
if(c==t[...
#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;
}
最简单的结构体定义、输出
#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...
#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 ...
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 ...
#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...
#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()
{
...
#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...
#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...