原创 STL-泛型算法示例
#include"algorithm" #include"vector" #include"functional" #include"iostream" #include"cstdlib" using namespace std; te
原创 STL-初始化實驗
#include"vector" #include"iostream" #include"cstdlib" using namespace std; int main() { int num[10]={5,5,5,5,5,5,5,5,5
原创 STM32流水燈,小暢當初弄的小兒科…
#include "stm32f10x.h" GPIO_InitTypeDef GPIO_InitStructure; void Delay(__IO uint32_t nCount); int main(void) {
原创 STL-list的訪問與遍歷
#include"iostream" #include"list" #include"cstdlib" using namespace std; int main() { int ia[]={34,18,25,89,40,15,56,1
原创 STL-訪問向量信息
#include"iostream" #include"vector" #include"cstdlib" using namespace std; int main() { vectorivec(2,10); cout<<"Max_
原创 cmd 組合命令和管道命令的使用
1.& Usage:第一條命令 & 第二條命令 [& 第三條命令...] 用這種方法可以同時執行多條命令,而不管命令是否執行成功 2.&& Usage:第一條命令 && 第二條命令 [&& 第三條命令...] 用這種方法可以同
原创 部分揹包問題-貪心法源碼
#include #include //#include using namespace std; float Value[100]={0}; float Weight[100]={0}; struct performance { i
原创 51單片機-播放天空之城
#include //包含51單片機寄存器定義的頭文件 sbit sound=P3^7; //將sound位定義爲P3.7 unsigned int C; //儲存定時器的定時常數 //以下是C調低音的音頻宏定義
原创 c++任意數循環賽另一種遞歸實現方…
//動態申請比較難調試,誰需要請私信~ #include"iostream" #include"cstdlib" #include"vector" using namespace std; //vector> a; int n;//
原创 KMP算法求next數組和nextval…
當時對我幫助大大的~~~原文地址:KMP算法求next數組和nextval數組的簡單方法作者:小二晨Ellennext數組的求解方法是:第一位的next值爲0,第二位的next值爲1。後面求解每一位的next值時,根據前一位進行比
原创 基於STM32神舟系列開發板的讀取絕…
#include "stm32f10x.h" #include "stm32f10x_usart.h" #include #include #include #define CMD_BUFFER_LEN 100 GPIO_InitT
原创 STL-vector中reserve和resize的區…
#include"iostream" #include"vector" #include"cstdlib" using namespace std; int main() { vectorivec; cout<<ivec.size()<
原创 【轉】SWAP函數的幾種寫法
大一的時候深入理解swap,現在又翻出來了~~~原文地址:【轉】SWAP函數的幾種寫法作者:如水 你會寫幾種swap函數? swap函數估計是一個各種各樣程序都會頻繁用到的子程序,可是你知道它究竟有多少種不
原创 基於STM32神舟系列開發板的串口通…
#include "stm32f10x.h" #include "stm32f10x_usart.h" void RCC_Config(void); void GPIO_Config(void); void USART_Config(
原创 c++電話本程序
電話本的功能在menu菜單裏完全體現了: cout << "這是一個電話本程序,可以執行以下操作:" << endl; cout << "1->搜索一個電話" << endl; cout << "2-