一:排列的的規程序 二:迷宮程序 三:對于輸入的任意一個非負十進制整數,打印輸出與其等值的八進制數 四:利用模式串T的next函數求T在主串S中第pos個字符之后的位置的KMP算法 五:將所有在線性表Lb中但不在La中的數據元素插入到La中
上傳時間: 2015-11-21
上傳用戶:qw12
圖像處理,利用bilt 函數 Description: This example shows how to edit (cut,paste,copy) a selection of a bitmap using BitBlt function just like Microsoft Photo Editor does. It s really EASY! Take a look to the sample if you don t believe me and don t forget to VOTE FOR ME! Note: comments are in italian...i hadn t enough time to translate them all. Sorry..(VOTE!)
標簽: 圖像處理
上傳時間: 2013-12-18
上傳用戶:851197153
26.編寫一個具有如下樣式的類模板tmplt,用于實現所謂的反序輸出問題,其中使用了類型參數T(使所處理的元素類型可變化)以及普通參數n(元素個數也可變化): template <class T, int n> class tmplt { T arr[n] // n個T類型的數據存放于數組arr之中 public: void dataIn() //從鍵盤輸入n個T類型數據放入arr數組中 void reverseOut() //將arr數組中的數據按輸入的相反順序輸出 } 而后編制主函數,將類模板實例化為某個具體的類并說明類對象,之后通過對象調用其負責輸入數據的成員函數,再通過對象調用另一成員函數按反序輸出那些輸入數據。
上傳時間: 2014-01-07
上傳用戶:xiaoxiang
提 出了一種 網絡 化嵌 入 式 數 控 系統 , 系統 采 用 A RM 4 - D S P結 構 , 實現 了數 控 系統 的 小型 化 、 網絡 化 、 智能化 和 集成 化 。詳 細介 紹 了嵌入 式數 控 系統 內 CNC主控 單元 與 伺 服 驅動 及 I /0邏輯 控 制 等各 單 元 間的通信 、 車 間級 工 業 以太 網絡 的通信 和 i n t r a n e t / I n t e r n e t網絡 通信 , 并給 出 了關鍵 實現技 術。
標簽: 網絡
上傳時間: 2013-11-25
上傳用戶:as275944189
提 出了一種 網絡 化嵌 入 式 數 控 系統 , 系統 采 用 A RM 4 - D S P結 構 , 實現 了數 控 系統 的 小型 化 、 網絡 化 、 智能化 和 集成 化 。詳 細介 紹 了嵌入 式數 控 系統 內 CNC主控 單元 與 伺 服 驅動 及 I /0邏輯 控 制 等各 單 元 間的通信 、 車 間級 工 業 以太 網絡 的通信 和 i n t r a n e t / I n t e r n e t網絡 通信 , 并給 出 了關鍵 實現技 術。
標簽: 網絡
上傳時間: 2013-12-27
上傳用戶:huannan88
MyTask、YouTask和ThreeTask 。在主函數中創建任務MyTask。而YouTask和ThreeTask由任務MyTaskTask創建,其優先級分別為2、4、6。這三個任務都要占用資源s,任務YouTask訪問時間短一些,在任務MyTask和任務ThreeTask利用while(OSTime<T) {}增加訪問時間,T值分別為300,500。MyTask、YouTask和ThreeTask采用OSTimeDly(K)延時等待,K值均為200。這樣出現任務優先級反轉。為了解決優先級反轉,設計何種信號量既解決此問題。請先指出任務優先級反轉出現在哪里? 后顯示克服過程
標簽: ThreeTask YouTask MyTask MyTaskTask
上傳時間: 2016-12-23
上傳用戶:tb_6877751
無線應用協議(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
#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,求出其幅度譜。
上傳時間: 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