原创 c++基礎-set

set:二叉搜索樹維護的容器 #include <iostream> #include <set> using namespace std; int main(){ //聲明 set<int> s; //插入元素 s.in

原创 c++基礎-全排列函數

一.數組中使用 函數模板: next_permutation(arr, arr+size); 函數模板: prev_permutation(arr, arr+size); 解釋:arr爲數組,size爲數組長度。 next_

原创 c++基礎-string常見操作

1.獲取長度(length()) string str = "12345"; int l = str.length();//長度爲5 2.拼接(+) string str1 = "hello"; string str2 = "w

原创 軟件開發屏幕錄製軟件

網盤鏈接: 鏈接:https://pan.baidu.com/s/1pgOgoKHeF-3pqBtdOgRZLw 提取碼:pxty (完全免費,無需下載,解壓即用)

原创 卡特蘭數應用

1. Catalan數 先來看一段Catalan數列:1,1,2,5,14,42,132,429,1430,4862,16796,即 h(0)=1,h(1)=1,h(2)=2,h(3)=5... 怎麼求出來的呢?兩種方式 (1

原创 庫函數sort詳解

sort函數用法 1.sort函數包含在頭文件爲#include的c++標準庫中,調用標準庫裏的排序方法可以實現對數據的排序,但是sort函數是如何實現的,我們不用考慮! 2.sort函數的模板有三個參數: void sort (

原创 串的匹配

1.調用庫函數 從0開始查找第一次出現目標字符或者串的位置,找到返回位置,未找到返回string::npos。 #include <iostream> #include <string> using namespace std;

原创 天梯賽(L1-048)-矩陣A乘以B

題目: 樣例: 代碼: #include <iostream> using namespace std; int row1,col1,row2,col2; int a1[1000][1000]; int a2[1000][1

原创 天梯賽(L1-031)-到底是不是太胖了

題目: 樣例: 代碼: (雖然簡單,但是注意結構體的使用,注意輸出格式) #include <iostream> #include <cmath> using namespace std; typedef struct stu

原创 天梯賽(L1-011)-A-B

題目: 樣例: 代碼: #include <iostream> #include <string> using namespace std; int main(){ string s1; string s2;

原创 天梯賽(L1-017)-到底有多二

題目: 樣例: 代碼: #include <iostream> #include <cstdio> #include <string> using namespace std; int main(){ double ans=

原创 lower_bound()的使用

頭文件:algorithm lower_bound()返回值是一個迭代器,返回指向大於等於key的第一個值的位置 對象:有序數組或容器 數組中使用: #include <algorithm> #include <iostream>

原创 藍橋杯-奇妙的數字(2015-A-3)

標題:奇妙的數字 小明發現了一個奇妙的數字。它的平方和立方正好把0~9的10個數字每個用且只用了一次。 你能猜出這個數字是多少嗎? 請填寫該數字,不要填寫任何多餘的內容。 #include <iostream> #include

原创 天梯賽(L1-007)-念數字

題目: 樣例輸入輸出: 代碼: 方法1:利用整型轉字符串獲取長度 #include <iostream> #include <cmath> #include <sstream> using namespace std; int a

原创 天梯賽(L1-002)-打印漏斗

題目: 樣例: 代碼: #include <iostream> using namespace std; int main(void){ int sum = 1, num; char c; cin>>num>>c; in