08 2019 档案
摘要:数组二分查找 #include<iostream> using namespace std; template <typename T> int binary_search_array(const T& key,const T data[],int N) { if(N<0) return -1; i
阅读全文
摘要:#include<iostream> #include<vector> #include<algorithm> #include<string> using namespace std; int main() { const int N=5; string a[N]={"www","algorith
阅读全文
摘要:对于一个(n,n)大小的矩阵,使得对角线上的元素全为x,其他元素都是y #include<iostream> #include<vector> using namespace std; int main() { const int n=20; int x=4; int y=2; int M[n][n
阅读全文
摘要:字符串操作 #include<iostream> #include<string> using namespace std; int main() { string name; cin>>name; cout<<"Hello ,"<<name<<endl; cout<<name.size()<<en
阅读全文
摘要:一般是Input和下面的变量重名了,导致model里面的input变成了第二次出现的Input变量,而不是最开始模型中作为输入的Input变量 改正方法:给第二个变量赋一个新名字即可
阅读全文