原创 MATLAB-logistics迴歸(人口增長阻塞模型)

%logistics迴歸(人口模型)a=textread('data4.txt');x=a([2:2:6],:)';x=nonzeros(x);%%相應時間人口t=[1790:10:2000]';%%已知數據時間點%x=[544 1376

原创 C++-查找模板-lower_bound()、upper_bound()

查找時前先要對數據預處理排序(升序) 數組形式 ​#include<cstdio> #include<iostream> #include<algorithm> #include<vector> using namespace std;

原创 C++-getline()

#include<cstdio> #include<iostream> #include<cstring> using namespace std; int main(){ int T; cin>>T; getchar(); //

原创 訓練指南-3.1數據結構-uva11991(map)

#include<cstdio> #include<iostream> #include<map> #include<vector> using namespace std; map<int,vector<int> > a; int

原创 MATLAB-圖片保存爲原始大小(無多餘白框)

matlab顯示的圖片,或者用matlab畫出來的圖片,手動保存時四周有白邊。 用File-Save或者Save As保存後,發現圖片的四周有白邊,有時候這些白邊不是我們想要的,這是爲什麼呢,怎麼辦呢? 這是因爲File-Save的方式保

原创 入門經典-6.3樹和二叉樹-4非二叉樹-uva297四分樹-先序遍歷,黑白圖像⭐⭐⭐⭐⭐難度:2

#include<cstdio> #include<iostream> #include<cstring> using namespace std; const int maxn=1024+10; const int len=32; ch

原创 MATLAB-逐行寫入txt

fid=fopen('D:\數學建模\s1.txt','wt'); Sl=length(S);%S爲包含13個矩陣的元胞 for k=1:13 [row,col]=size(S{k}); fprintf(fid,'%g

原创 入門經典-7.1簡單枚舉,182-uva725除法-排列,sprintf(),生成測試法❤難度:1

#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> using namespace std; char buf[99]; int main()

原创 C++-結構體

#include<cstdio> #include<iostream> #include<algorithm>//system() using namespace std; struct point { int x,y;//①

原创 Python-excel按指定順序自動排序

import openpyxl wb1=openpyxl.load_workbook('tsp_result.xlsx') wb2=openpyxl.load_workbook('144.xlsx') sheet1=wb1.ge

原创 入門經典-習題5-5,41-uva10391複合詞-string assign,set⭐⭐⭐⭐⭐難度:1

對set集合的每個單詞遍歷不同位置切分,查詢左右兩部分是否在集合中不要直接枚舉左右兩部分判斷複合詞是否在集合中時間複雜度較大#include<cstdio> #include<iostream> #include<set> #includ

原创 Python-Excel獲取最大行與列

《python編程快速上手》中的第12章:處理Excel電子表格。 get_highest_row()和get_highest_column()在最新版的openpyxl模塊中已經被刪除了,取而代之的是max_row和max_column

原创 訓練指南-2.1-計數-uva11401數三角形-遞推

題目:有多少種方法可以從1,2,3,...,n中選出三個數,構成三角形#include<cstdio> #include<iostream> using namespace std; long long f[1000010]; int m

原创 入門經典-6.4圖-163-uva1103古代象形符號-四連塊,DFS,種子填充,圖像識別⭐⭐⭐⭐⭐複雜度:4

#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<vector> #include<set> using namespac

原创 入門經典-5.2.3集合:set-112-uva10815安迪的字典-string,sstream,iterator,set⭐⭐⭐⭐⭐難度:1

#include<cstdio> #include<iostream> #include<cstring> #include<set> #include<sstream> using namespace std; set<string>