<html>

<head>

<title>WZZX STS</title>

<style>


.d{position:fixed;top:0px;left:0px;width:100%;height:100px;background-color:FF90DD}

 </style>

</head>



<body>


<div class="d">

 <table>

<tr>

<td><img src="wz.jpg" ;height="50px";href="http://wzsts.net3v.net/"/></td> <td> 

<a href="0.html">_ 首页 _</a>

<a href="1.html">_ 1 _</a><a href="2.html">_ 2 _</a><a href="3.html">_ 3 _</a><a href="4.html">_ 4 _</a><a href="5.html">_ 5 _</a>  

<a href="6.html">_ 6 _</a><a href="7.html">_ 7 _</a><a href="8.html">_ 8 _</a><a href="9.html">_ 9 _</a><a href="10.html">_ 10_</a>

<a href="11.html">_ 11_</a><a href="12.html">_ 12 _</a><a href="13.html">_ 13 _</a><a href="14.html">_ 14 _</a><a href="15.html">_ 15 


_</a>  

<a href="16.html">_ 16 _</a><a href="17.html">_ 17 _</a><a href="18.html">_ 18 _</a><a href="19.html">_ 19 _</a><a href="20.html">_ 


20_</a>

</td>

</tr>

</table>

</div>

<br><br><br><br><br><br><br>

 <audio controls="controls" hidden="hidden" autoplay="autoplay" loop="loop">

 <source src="1.mp3" type="audio/mpeg" />

</audio>


<table>

<tr>

<td> 1

 <pre>

【命名空间】

            namespace std;

            namespace wz

              { int a=10;

               void fun() {}  可以命名函数

               }

       变量引用:单一引用为wz::a;全引用为using  namespace wz ;

【函数重载】

            用同样的函数名做不一样的事;机制为重命名;

           int add(int a,int b){} float add(float a,float b){} 

【缺省参数】

           int add(int a=1,int b=0){return a+b;}main中add(1)为1。add(1,1)为2;

           全缺省/半缺省

【引用和指针】

         int& refa=10;必须初始化,自加为量变大   sizeof(refa)=8/4/2看引用类型               特别的引用量间的地址是一样的

         *p:                  p++ 自加为地址偏移  sizeof(p)=4      始终为4

【内存对齐】

           char 2/int4 =8 char 2/double 8/int4 =24 class类和struc结构体一致

【析构函数】

            没有参数,不能重载;虽然为默认函数,但没有内存回收,需要自己写关闭文件等代码。

</pre>

</td>  


<td> 2

extern"c" //c++ 引入c代码

<pre>

double i=1.234

const int& refi=i;

cout<<&i<<&refi<<endl;

这个是不一样的地址;const必须加;

</pre>

</td>


</tr>

 

 <tr>

<td> 1

 <pre>


</pre>

</td>  


<td> 2 </td>


</tr>

 <tr>

<td> 1

 <pre>





while(check)

{

cc=player(c,aa);

bb=play(b,cc);

aa=play(c,bb);

check=a||b||c;

}



 

int player(int c[],int aa[])

{

int m[25]={0};

int i,j,k;

int count=0;

int xx=0;

for(i=0;i<25;i++)

{ if(aa[i]!=0)

     { count++; if(count==1) x=1;

                if(count==2) x=2;                 

     }

 }

   

switch(x)

 {

  case 1:{

          printf("please enter a number;\n ");

          scanf("%d",xx);

          aa[0]=xx;

          }

//  case 2:fun2(v,m);

  }


for(i=0;i<25;i++)

{

printf("%3d",m[i]);

}

printf("\n");

return m;

}

 

int play(int v[],int vv[])

{

int m[25]={0};

int i,j,k;

int count=0;

for(i=0;i<25;i++)

{ if(vv[i]!=0)

     { count++; if(count==1) x=1;

                if(count==2) x=2;                 

     }

 }

   

switch(x)

 {

  case 1:fun1(v,m);

//  case 2:fun2(v,m);

  }


for(i=0;i<25;i++)

{

printf("%3d",m[i]);

}

printf("\n");

return m;

}


void fun1(int v[],int m[])

{

int t=0;

t=v[1];

m[0]=t;

v[1]=0;

}


void fun2(int v[],int m[])

{


}









{

int a[10]={1,3,5,7,9,2,4,6,8,0};

3 1                 0

3 5 1               1

3 5 7 1             2

3 5 7 9 1           3

3 5 7 9 2 1         4

3 5 7 9 2 4 1       5

3 5 7 9 2 4 6 1     6

3 5 7 9 2 4 6 8 1   7

3 5 7 9 2 4 6 8 1 0 8

//

5 3                 0

5 7 3               1

5 7 9 3             2

5 7 9 3 2           3

5 7 9 3 4 2         4

5 7 9 3 4 6 2       5

5 7 9 3 4 6 8 2     6

5 7 9 3 4 6 8 2 1 0 7

//

0 7 5

1 7 9 5

2 7 9 5 3

3 7 9 5 4 3

4 7 9 5 4 6 3

5 7 9 5 4 6 8 3

6 7 9 5 4 6 8 3 2 1 0

//

0 9 7

1 9 7 5 4 6 8 3 2 1 0

2 9 7 5 4 6

3 9 7 5 6 4

4 9 7 5 6 8 4 3 2 1 0

5 9 7 5 6 8 4 3 2 1 0

//

0 9 7

1 9 7 5

2 9 7 6 5

3 9 7 6 8 5 4

4 9 7 6 8 5 4 3 2 1 0

//

0 9 7

1 9 7 6

2 9 7 8 6 5

3

//

0 9 7

1 9 8 7 6 5

//

0 9 8




#include<stdio.h>

#include<stdlib.h>

#define n 4

#define m 4

#define Datatype int

typedef struct linklist

{       

        Datatype  data;

     struct linklist   *left;   

     struct linklist   *right;

}linknode,*l,*r;


void fun1()

{

 int i=0,j=0,k=0,a[n][m]={0};

 for(i=0;i<n;i++)

 for(j=0;j<m;j++)

 {

scanf("%d",&a[i][j]);

printf("%2d",a[i][j]);

 }


}



void fun2()

{

 

int i=0,j=0,k=0,a[n][m]={0};

for(i=0;i<n;i++)

 for(j=0;j<m;j++)

 {

scanf("%d",&a[i][j]);

 }

 fflush(stdin);

for(i=0;i<n;i++)

 for(j=0;j<m;j++)

 {

printf("%2d",a[i][j]);

 }

fflush(stdout);

 

void fun3()

{

int a[10]={11,2,5,6,7,3,4,9,10,1};

int l;

int i,j,t;

int b[3]={10,10,10};

for(l=0;l<10;l++)

 {

  if(a[l]<b[0])

  b[0]=a[l];

for(i=0;i<3;i++)

 { 

  for(j=i;j<3;j++)

   {  

     if (b[j]<b[j+1]) {    t=b[i];b[i]=b[j+1];b[j+1]=t;}

    }

 }

}


for(i=0;i<3;i++) printf("%2d",b[i]);

 

}

 void fun4()

{

int l=1;

l mylist=(linknode* )malloc(sizeof(linknode));

//list headcopy=(linknode* )malloc(sizeof(linknode));

mylist->data=1;


}

void main()

{

//printf("\n  test 1 enter %d*%d number\n",n,m);

//fun1();

//printf("\n  test 2 enter %d*%d number\n",n,m);

//fun2();

printf("\n  test  \n \n",n,m);

//fun3();

fun4();

printf("\n  test  had finish\n",n,m);


}



 #include<stdio.h>

#include<stdlib.h>

#define Datatype int

typedef struct linklist

{

        Datatype  data;

struct linklist   *next;

}linknode,* list;

void fun2(list head)

{

  list p=head;

  while(p->next!=NULL)

  {

    p=p->next;

    printf("%d",p->data);

   }

//free(head);

}

int judge(list mylist1)

{

  int l=6,j=8;list p=mylist1; list s=mylist1,t=mylist1;

  printf("\n%d\n",l);


while(j){printf("%2d",p->data);p=p->next;j--;}



    while(l){s=s->next;t=(t->next)->next;

          if(t->next=s){printf("\n it is loop\n");break;}   

          l=l-1;

        }


return 0;

}

void ysf(list head)

{ int count=0;//  4;

  int r=4;

  list p=head->next;  

   list del=NULL;

while(r>1)

{ while(count<4)

  {

   p=p->next;

   count++;

  }

 del=pd->next;r--;

 p->next=del->next;

 free(del);

}

}

void main()

{int l=1;

list mylist=(linknode* )malloc(sizeof(linknode));

list headcopy=(linknode* )malloc(sizeof(linknode));

list mylist1=(linknode* )malloc(sizeof(linknode));

list p=mylist1;

while(l<5)

{

list  newnode=(linknode* )malloc(sizeof(linknode));

newnode->data=l;

p->next=newnode;

p=p->next;

l++;

}

p->next=mylist1->next;

 judge(mylist1);

//wutoushan();

ysf(mylist);

judge(mylist1);


 }

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

void display(int x,int y,int m,int max)

{

int s[6][7]={0};int i=0,j=0;

  s[0][m]=1;//确定每一月的根基 每个月的第一列 

for(j=m;j<7;j++)s[0][j]=(j-m)+s[0][m];

s[1][0]=s[0][6]+1;

for(i=2;i<6;i++)s[i][0]=s[1][0]+(i-1)*7;

  for(i=1;i<6;i++)

  { for(j=1;j<7;j++)

     s[i][j]=s[i][0]+j;

  }


printf("\t%d年  %d月\n",x,y);

printf("----------------------\n");

printf(" 日 一 二 三 四 五 六 \n");

for(i=0;i<6;i++)

  { for(j=0;j<7;j++)

    {

   if(s[i][j]==0)printf("   ");

   if(s[i][j]!=0&&s[i][j]<=max)printf("%3d",s[i][j]);}

   printf("\n");  

  }

}

int Year(int year)

{

if(year%4==0&&year%100!=0||year%400==0)return 1;

else return 0;

}

   

void  fun()

{

int i,j;

int max[13]={0,30,31,32,33,30,30,30,30,30,30,30,30};

int star[13]={1,2,3,4,5,5,1,6,5,4,3,2,1,};

int x[42]={0};

for(i=1;i<=12;i++)

  {printf("%d year %d math\n",2015,i);

   printf(" 7  1  2  3  4  5  6 \n");

   printf("---------------------\n" );

    for(j=star[i];j<42;j++)

   {    x[j]=x[j-1]+1;}

    for(j=0;j<42;j++)

   { 

     if(j>0&&j%7==0)printf("\n");

     if(x[j]==0)printf("   ");   

     if(x[j]!=0&&x[j]<max[i])printf("%3d",x[j]);

   }

  printf("-----happy new year---\n");

  }

}

void main()

{

int max[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

int year=2016;

int month=2;//1-12

int star[13]={0,1,32,60,91,121,152,182,213,244,274,304,334};//0-6 

 

int i=1;

int count=0;

if(Year(year)) {max[2]++;for(i=3;i<=12;i++)star[i]++;}

for(i=1;i<year;i++)

{if(Year(i))count++;}

for(i=1;i<=12;i++)

 {//star[i]= (1+2*i+3*(i+1)/5+year+year/4-year/100+year/400)%7;

  star[i]=(star[i]+(year-1)*365+count)%7;

 display(year,i,star[i],max[i]); 

 }

//fun();

}

</pre>

</td>  


<td> 2 </td>


</tr>

 


</table>

</body>

</html>