-
無線應用協議(Wireless Application Protocol,WA P)是WAP論壇經過不斷努力得到的成果,它提供了一個業界技術規范,以便開發出適用于各種無線通信網絡的應用程序和業務。
WAP規定了適用于多種無線設備的網絡協議和應用程序框架,這些設備包括移動電話、尋呼機、個人數字助理( P D A)等。這個規范不但擴充了移動組網技術(如數字數據組網標準)和I n t e r n e t技術(如X M L,U R L,腳本和各種各樣的內容格式) ,而且還將推動他們的發展。
標簽:
Application
Wireless
Protocol
無線應用
上傳時間:
2017-03-13
上傳用戶:wcl168881111111
-
Kullanı lan bazı matlab bilgileri
Matlabda kodlar mfile lara yazı lı p kaydedilebilir. Ü st menüden, file, new, mfile. Command windowa yazdı kları nı zı kaydedemezsiniz. Yazdı ğ ı nı z kodu ç alı ş tı rabilmeniz iç in ç alı ş tı ğ ı nı z current directory nin altı na kaydetmelisiniz. Current directory i dosyanı n bulunduğ u yere de gö türebilirsiniz
標簽:
305
bilgileri
kaydedile
Matlabda
上傳時間:
2014-01-06
上傳用戶:miaochun888
-
兩個鏈表的交集
#include<stdio.h>
#include<stdlib.h>
typedef struct Node{
int data;
struct Node *next;
}Node;
void initpointer(struct Node *p){
p=NULL;
}
int printlist(struct Node* head){
int flag=1;
head=head->next;
/*
因為標記1的地方你用了頭結點,所以第一個數據域無效,應該從下一個頭元結點開始
*/
if(head==NULL)
printf("NULL\n");
else
{
while(head!=NULL)
{
if(flag==1)
{
printf("%d",head->data);
flag=0;
}
else
{
printf(" %d",head->data);
}
head=head->next;
}
printf("\n");
}
return 0;
}
struct Node *creatlist(struct Node *head)
{
int n;
struct Node *p1=(struct Node *)malloc(sizeof(struct Node));
p1->next=NULL;
while(scanf("%d",&n),n!=-1)
{
struct Node *pnode=(struct Node *)malloc(sizeof(struct Node));
pnode->next=NULL;
pnode->data=n;
if(head==NULL)
head=pnode;
p1->next=pnode;
p1=pnode;
}
return head;
}
struct Node *Intersect(struct Node *head1, struct Node *head2)
{
struct Node *p1=head1,*p2=head2;/*我這里沒有用頭指針和頭結點,這里是首元結點head1里面就是第一個數據,一定要理解什么事頭指針,
頭結點,和首元結點
具體你一定要看這個博客:http://blog.sina.com.cn/s/blog_71e7e6fb0101lipz.html*/
struct Node *head,*p,*q;
head = (struct Node *)malloc(sizeof(struct Node));
head->next = NULL;
p = head;
while( (p1!=NULL)&&(p2!=NULL) )
{
if (p1->data == p2->data)
{
q = (struct Node *)malloc(sizeof(struct Node));
q->data = p1->data;
q->next = NULL;
p->next = q;//我可以認為你這里用了頭結點,也就是說第一個數據域無效 **標記1**
p = q;
p1 = p1->next;
p2 = p2->next;
}
else if (p1->data < p2->data)
{
p1 = p1->next;
}
else
{
p2 = p2->next;
}
}
return head;
}
int main()
{
struct Node *head=NULL,*headt=NULL,*t;
//initpointer(head);//這里的函數相當于head=NULL;
// initpointer(headt);//上面已經寫了headt=NULL那么這里可以不用調用這個函數
head=creatlist(head);
headt=creatlist(headt);
t=Intersect(head,headt);
printlist(t);
}
標簽:
c語言編程
上傳時間:
2015-04-27
上傳用戶:coco2017co
-
#include <iostream>
#include <stdio.head>
#include <stdlib.head>
#include <string.head>
#define ElemType int
#define max 100
using namespace std;
typedef struct node1
{
ElemType data;
struct node1 *next;
}Node1,*LinkList;//鏈棧
typedef struct
{
ElemType *base;
int top;
}SqStack;//順序棧
typedef struct node2
{
ElemType data;
struct node2 *next;
}Node2,*LinkQueue;
typedef struct node22
{
LinkQueue front;
LinkQueue rear;
}*LinkList;//鏈隊列
typedef struct
{
ElemType *base;
int front,rear;
}SqQueue;//順序隊列
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//1.采用鏈式存儲實現棧的初始化、入棧、出棧操作。
LinkList CreateStack()//創建棧
{
LinkList top;
top=NULL;
return top;
}
bool StackEmpty(LinkList s)//判斷棧是否為空,0代表空
{
if(s==NULL)
return 0;
else
return 1;
}
LinkList Pushead(LinkList s,int x)//入棧
{
LinkList q,top=s;
q=(LinkList)malloc(sizeof(Node1));
q->data=x;
q->next=top;
top=q;
return top;
}
LinkList Pop(LinkList s,int &e)//出棧
{
if(!StackEmpty(s))
{
printf("棧為空。");
}
else
{
e=s->data;
LinkList p=s;
s=s->next;
free(p);
}
return s;
}
void DisplayStack(LinkList s)//遍歷輸出棧中元素
{
if(!StackEmpty(s))
printf("棧為空。");
else
{
wheadile(s!=NULL)
{
cout<<s->data<<" ";
s=s->next;
}
cout<<endl;
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//2.采用順序存儲實現棧的初始化、入棧、出棧操作。
int StackEmpty(int t)//判斷棧S是否為空
{
SqStack.top=t;
if (SqStack.top==0)
return 0;
else return 1;
}
int InitStack()
{
SqStack.top=0;
return SqStack.top;
}
int pushead(int t,int e)
{
SqStack.top=t;
SqStack.base[++SqStack.top]=e;
return SqStack.top;
}
int pop(int t,int *e)//出棧
{
SqStack.top=t;
if(!StackEmpty(SqStack.top))
{
printf("棧為空.");
return SqStack.top;
}
*e=SqStack.base[s.top];
SqStack.top--;
return SqStack.top;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//3.采用鏈式存儲實現隊列的初始化、入隊、出隊操作。
LinkList InitQueue()//創建
{
LinkList head;
head->rear=(LinkQueue)malloc(sizeof(Node));
head->front=head->rear;
head->front->next=NULL;
return head;
}
void deleteEle(LinkList head,int &e)//出隊
{
LinkQueue p;
p=head->front->next;
e=p->data;
head->front->next=p->next;
if(head->rear==p) head->rear=head->front;
free(p);
}
void EnQueue(LinkList head,int e)//入隊
{
LinkQueue p=(LinkQueue)malloc(sizeof(Node));
p->data=e;
p->next=NULL;
head->rear->next=p;
head->rear=p;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//4.采用順序存儲實現循環隊列的初始化、入隊、出隊操作。
bool InitQueue(SqQueue &head)//創建隊列
{
head.data=(int *)malloc(sizeof(int));
head.front=head.rear=0;
return 1;
}
bool EnQueue(SqQueue &head,int e)//入隊
{
if((head.rear+1)%MAXQSIZE==head.front)
{
printf("隊列已滿\n");
return 0;
}
head.data[head.rear]=e;
head.rear=(head.rear+1)%MAXQSIZE;
return 1;
}
int QueueLengthead(SqQueue &head)//返回隊列長度
{
return (head.rear-head.front+MAXQSIZE)%MAXQSIZE;
}
bool deleteEle(SqQueue &head,int &e)//出隊
{
if(head.front==head.rear)
{
cout<<"隊列為空!"<<endl;
return 0;
}
e=head.data[head.front];
head.front=(head.front+1)%MAXQSIZE;
return 1;
}
int gethead(SqQueue head)//得到隊列頭元素
{
return head.data[head.front];
}
int QueueEmpty(SqQueue head)//判斷隊列是否為空
{
if (head.front==head.rear)
return 1;
else
return 0;
}
void travelQueue(SqQueue head)//遍歷輸出
{
wheadile(head.front!=head.rear)
{
printf("%d ",head.data[head.front]);
head.front=(head.front+1)%MAXQSIZE;
}
cout<<endl;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//5.在主函數中設計一個簡單的菜單,分別測試上述算法。
int main()
{
LinkList top=CreateStack();
int x;
wheadile(scanf("%d",&x)!=-1)
{
top=Pushead(top,x);
}
int e;
wheadile(StackEmpty(top))
{
top=Pop(top,e);
printf("%d ",e);
}//以上是鏈棧的測試
int top=InitStack();
int x;
wheadile(cin>>x)
top=pushead(top,x);
int e;
wheadile(StackEmpty(top))
{
top=pop(top,&e);
printf("%d ",e);
}//以上是順序棧的測試
LinkList Q;
Q=InitQueue();
int x;
wheadile(scanf("%d",&x)!=-1)
{
EnQueue(Q,x);
}
int e;
wheadile(Q)
{
deleteEle(Q,e);
printf("%d ",e);
}//以上是鏈隊列的測試
SqQueue Q1;
InitQueue(Q1);
int x;
wheadile(scanf("%d",&x)!=-1)
{
EnQueue(Q1,x);
}
int e;
wheadile(QueueEmpty(Q1))
{
deleteEle(Q1,e);
printf("%d ",e);
}
return 0;
}
標簽:
數據結構
實驗
上傳時間:
2018-05-09
上傳用戶:123456..
-
已知信號x(t)=0.15sin(2*pi*f1*t)+sin(2*pi*f2*t)-0.1sin(2*pi*f3*t),其中,f1=1Hz,f2=2Hz,f3=3Hz。采樣頻率為32Hz。(1)做32點FFT,求出其幅度譜;(2)做64點FFT,求出其幅度譜。
標簽:
MATLAB
FFT變換
上傳時間:
2019-01-04
上傳用戶:知復何言
-
#include<stdio.h>
#define TREEMAX 100
typedef struct BT
{
char data;
BT *lchild;
BT *rchild;
}BT;
BT *CreateTree();
void Preorder(BT *T);
void Postorder(BT *T);
void Inorder(BT *T);
void Leafnum(BT *T);
void Nodenum(BT *T);
int TreeDepth(BT *T);
int count=0;
void main()
{
BT *T=NULL;
char ch1,ch2,a;
ch1='y';
while(ch1=='y'||ch1=='y')
{
printf("\n");
printf("\n\t\t 二叉樹子系統");
printf("\n\t\t*****************************************");
printf("\n\t\t 1---------建二叉樹 ");
printf("\n\t\t 2---------先序遍歷 ");
printf("\n\t\t 3---------中序遍歷 ");
printf("\n\t\t 4---------后序遍歷 ");
printf("\n\t\t 5---------求葉子數 ");
printf("\n\t\t 6---------求結點數 ");
printf("\n\t\t 7---------求樹深度 ");
printf("\n\t\t 0---------返 回 ");
printf("\n\t\t*****************************************");
printf("\n\t\t 請選擇菜單號 (0--7)");
scanf("%c",&ch2);
getchar();
printf("\n");
switch(ch2)
{
case'1':
printf("\n\t\t請按先序序列輸入二叉樹的結點:\n");
printf("\n\t\t說明:輸入結點(‘0’代表后繼結點為空)后按回車。\n");
printf("\n\t\t請輸入根結點:");
T=CreateTree();
printf("\n\t\t二叉樹成功建立!\n");break;
case'2':
printf("\n\t\t該二叉樹的先序遍歷序列為:");
Preorder(T);break;
case'3':
printf("\n\t\t該二叉樹的中序遍歷序列為:");
Inorder(T);break;
case'4':
printf("\n\t\t該二叉樹的后序遍歷序列為:");
Postorder(T);break;
case'5':
count=0;Leafnum(T);
printf("\n\t\t該二叉樹有%d個葉子。\n",count);break;
case'6':
count=0;Nodenum(T);
printf("\n\t\t該二叉樹總共有%d個結點。\n",count);break;
case'7':
printf("\n\t\t該樹的深度為:%d",TreeDepth(T));
break;
case'0':
ch1='n';break;
default:
printf("\n\t\t***請注意:輸入有誤!***");
}
if(ch2!='0')
{
printf("\n\n\t\t按【Enter】鍵繼續,按任意鍵返回主菜單!\n");
a=getchar();
if(a!='\xA')
{
getchar();
ch1='n';
}
}
}
}
BT *CreateTree()
{
BT *t;
char x;
scanf("%c",&x);
getchar();
if(x=='0')
t=NULL;
else
{
t=new BT;
t->data=x;
printf("\n\t\t請輸入%c結點的左子結點:",t->data);
t->lchild=CreateTree();
printf("\n\t\t請輸入%c結點的右子結點:",t->data);
t->rchild=CreateTree();
}
return t;
}
void Preorder(BT *T)
{
if(T)
{
printf("%3c",T->data);
Preorder(T->lchild);
Preorder(T->rchild);
}
}
void Inorder(BT *T)
{
if(T)
{
Inorder(T->lchild);
printf("%3c",T->data);
Inorder(T->rchild);
}
}
void Postorder(BT *T)
{
if(T)
{
Postorder(T->lchild);
Postorder(T->rchild);
printf("%3c",T->data);
}
}
void Leafnum(BT *T)
{
if(T)
{
if(T->lchild==NULL&&T->rchild==NULL)
count++;
Leafnum(T->lchild);
Leafnum(T->rchild);
}
}
void Nodenum(BT *T)
{
if(T)
{
count++;
Nodenum(T->lchild);
Nodenum(T->rchild);
}
}
int TreeDepth(BT *T)
{
int ldep,rdep;
if(T==NULL)
return 0;
else
{
ldep=TreeDepth(T->lchild);
rdep=TreeDepth(T->rchild);
if(ldep>rdep)
return ldep+1;
else
return rdep+1;
}
}
標簽:
二叉樹
子系統
上傳時間:
2020-06-11
上傳用戶:ccccy
-
#include <stdio.h>
#include <stdlib.h>
#define SMAX 100
typedef struct SPNode
{
int i,j,v;
}SPNode;
struct sparmatrix
{
int rows,cols,terms;
SPNode data [SMAX];
};
sparmatrix CreateSparmatrix()
{
sparmatrix A;
printf("\n\t\t請輸入稀疏矩陣的行數,列數和非零元素個數(用逗號隔開):");
scanf("%d,%d,%d",&A.cols,&A.terms);
for(int n=0;n<=A.terms-1;n++)
{
printf("\n\t\t輸入非零元素值(格式:行號,列號,值):");
scanf("%d,%d,%d",&A.data[n].i,&A.data[n].j,&A.data[n].v);
}
return A;
}
void ShowSparmatrix(sparmatrix A)
{
int k;
printf("\n\t\t");
for(int x=0;x<=A.rows-1;x++)
{
for(int y=0;y<=A.cols-1;y++)
{
k=0;
for(int n=0;n<=A.terms-1;n++)
{
if((A.data[n].i-1==x)&&(A.data[n].j-1==y))
{
printf("%8d",A.data[n].v);
k=1;
}
}
if(k==0)
printf("%8d",k);
}
printf("\n\t\t");
}
}
void sumsparmatrix(sparmatrix A)
{
SPNode *p;
p=(SPNode*)malloc(sizeof(SPNode));
p->v=0;
int k;
k=0;
printf("\n\t\t");
for(int x=0;x<=A.rows-1;x++)
{
for(int y=0;y<=A.cols-1;y++)
{
for(int n=0;n<=A.terms;n++)
{
if((A.data[n].i==x)&&(A.data[n].j==y)&&(x==y))
{
p->v=p->v+A.data[n].v;
k=1;
}
}
}
printf("\n\t\t");
}
if(k==1)
printf("\n\t\t對角線元素的和::%d\n",p->v);
else
printf("\n\t\t對角線元素的和為::0");
}
int main()
{
int ch=1,choice;
struct sparmatrix A;
A.terms=0;
while(ch)
{
printf("\n");
printf("\n\t\t 稀疏矩陣的三元組系統 ");
printf("\n\t\t*********************************");
printf("\n\t\t 1------------創建 ");
printf("\n\t\t 2------------顯示 ");
printf("\n\t\t 3------------求對角線元素和");
printf("\n\t\t 4------------返回 ");
printf("\n\t\t*********************************");
printf("\n\t\t請選擇菜單號(0-3):");
scanf("%d",&choice);
switch(choice)
{
case 1:
A=CreateSparmatrix();
break;
case 2:
ShowSparmatrix(A);
break;
case 3:
SumSparmatrix(A);
break;
default:
system("cls");
printf("\n\t\t輸入錯誤!請重新輸入!\n");
break;
}
if (choice==1||choice==2||choice==3)
{
printf("\n\t\t");
system("pause");
system("cls");
}
else
system("cls");
}
}
標簽:
數組
子系統
上傳時間:
2020-06-11
上傳用戶:ccccy
-
漏電感在開關電源主回路中一定存在,尤其在變壓器、電感器等中都是不可避免的。過去在討論中一般把它略而不計,設計中更無從考慮。現在隨著開關電源的單機容量和整機容量的日益提高,這個參數影響到開關電源主要的參數,例如,40A/5V輸出的開關電源,電壓損失竟達20%,還影響到開關電源的重量和效率。因此,漏電感問題討論、研究已擺到日程上了。加上脈沖電壓VS(t)到變壓器線圈就產生電流,沿著鐵心磁徑產生閉合的主磁通Φ(t)和部分路徑在鐵心附近的空氣中閉合的漏磁通Φσ(t)。Φ(t)和Φσ(t)將在線圈分別產生感應電動勢e(t)和eσ(t),兩者之和加上電阻壓降與外加電壓相平衡,遵從KVL方程。過去,一般書刊略去eσ(t), KVL方程簡化為Vs(t)=Δt 。
標簽:
漏電
開關電源
上傳時間:
2021-11-23
上傳用戶:trh505
-
Extensively rewritten to present the C++11 language, standard library, and key design techniques as an integrated whole, Stroustrup thoroughly addresses changes that make C++11 feel like a whole new language, offering definitive guidance for leveraging its improvements in performance, reliability, and clarity. C++ programmers around the world recognize Bjarne Stoustrup as the go-to expert for the absolutely authoritative and exceptionally useful information they need to write outstanding C++ programs. Now, as C++11 compilers arrive and development organizations migrate to the new standard, they know exactly where to turn once more: Stoustrup's C++ Programming Language, Fourth Edition.Bjarne Stroustrup是C++的設計師和最早的實現者,也是《C++程序設計語言》、《帶標注的C++參考手冊》和《C++語言的設計與演化》的作者。他從丹麥Aarhus大學和英國牛津大學畢業,現在是AT&T大規模程序設計研究部的負責人,AT&T特別成員,AT&T貝爾實驗室特別成員,以及ACM特別成員。Stroustrup的研究興趣包括分布式系統、操作系統、模擬、設計和程序設計。他也是Addison·Wesley的C++In-Depth系列書籍的編輯。
標簽:
C++
上傳時間:
2022-02-01
上傳用戶:
-
宏晶 STC15F2K60S2開發板配套軟件源碼 基礎例程30例/**********************基于STC15F2K60S2系列單片機C語言編程實現使用如下頭文件,不用另外再包含"REG51.H"#include <STC15F2K60S2.h>***********************/#include "STC15F2K60S2.H"//#include "REG51.H" //sfr P4 = 0xC0;#define uint unsigned int #define uchar unsigned char /**********************引腳別名定義***********************/sbit SEL=P4^3; // LED和數碼管選擇引腳 高:LED有效 低:數碼管有效 // SEL連接的單片機引腳必須為帶有上拉電阻的引腳 或將其直接連接VCC#define data P2 // 數據輸入定義 /**********************函數名稱:Delay_1ms功能描述:延時入口參數:unsigned int t 表示要延時t個1ms 出口參數:無備注:通過參數t,控制延時的時間長短***********************/void Delay_1ms(uint t){ uchar j; for(;t>0;t--) for(j=110;j>0;j--) ;}/**********************函數名稱:Led_test功能描述:對8個二極管進行測試,依次輪流點亮8個二極管入口參數:無出口參數:無備注: ***********************/void Led_test(){ uchar G_value=0x01; // 給變量賦初值 SEL=1; //高電平LED有效 while(1) { data=G_value; Delay_1ms(10000); G_value=G_value<<1; if(G_value==0x00) { data=G_value; Delay_1ms(10000); G_value=0x01; } }}/***********************主函數************************/void main(){ ///////////////////////////////////////////////// //注意: STC15W4K32S4系列的芯片,上電后所有與PWM相關的IO口均為 // 高阻態,需將這些口設置為準雙向口或強推挽模式方可正常使用 //相關IO: P0.6/P0.7/P1.6/P1.7/P2.1/P2.2 // P2.3/P2.7/P3.7/P4.2/P4.4/P4.5 ///////////////////////////////////////////////// P4M1=0x00; P4M0=0x00; P2M0=0xff; P2M1=0x00; //將P2設為推挽 Led_test(); }
標簽:
STC15F2K60S2
上傳時間:
2022-05-03
上傳用戶: