摘要: #include <string.h>#include <vector>#include <algorithm>#include <string>#include <iostream>using namespace std;void main(){ string m("----------asdfas--------------dfgdf---------"); string::iterator it; vector<char> csr; vector<char>::iterator cit 阅读全文
posted @ 2012-02-09 01:03 Dsp Tian 阅读(700) 评论(0) 推荐(0)
摘要: #include <iostream>#include <vector>#include <string>#include <algorithm>using namespace std;void main(){ string num; string strset1="."; string strset2="0"; int n; int wei; int sum_wei; cin>>num>>n; int first=num.find_first_of(strset1); if (fi 阅读全文
posted @ 2012-02-08 20:56 Dsp Tian 阅读(462) 评论(0) 推荐(0)
摘要: #include <iostream>using namespace std; void main(){ int a,b; cin>>a>>b; cout<<a+b<<endl;} 阅读全文
posted @ 2012-02-08 15:25 Dsp Tian 阅读(397) 评论(0) 推荐(0)
摘要: #include <string>#include <iostream>#include <algorithm>#include <vector>#include <fstream>using namespace std;int main(){ ifstream in("data.txt"); string strtmp; vector<string> vect; while (getline(in,strtmp,'\n')) vect.push_back(strtmp); copy(v 阅读全文
posted @ 2012-02-08 13:18 Dsp Tian 阅读(635) 评论(0) 推荐(0)
摘要: #include <iostream>#include <vector>#include <algorithm>using namespace std;int testscore[] = {67, 56, 24, 78, 99, 87, 56}; void main(){ vector<int> score(testscore,testscore+sizeof(testscore)/sizeof(int)); vector<int>::iterator it; copy(score.begin(),score.end(),ostrea 阅读全文
posted @ 2012-02-08 00:00 Dsp Tian 阅读(658) 评论(0) 推荐(0)
摘要: #include <iostream>#include <vector>#include <algorithm>#include <numeric>#include <string>using namespace std;int testscore[] = {67, 56, 24, 78, 99, 87, 56}; bool pass(int n){ if (n>=60) return true; else return false;}void main(){ vector<int> score(testscore, 阅读全文
posted @ 2012-02-07 21:27 Dsp Tian 阅读(797) 评论(0) 推荐(0)
摘要: #include <iostream>#include <vector>#include <string>#include <boost/shared_ptr.hpp>class A{public: A(std::string s){a=s;} std::string a; void print(){std::cout<<a<<'\n';} };void main(){ boost::shared_ptr<A> p1(new A("2345")); boost::shared 阅读全文
posted @ 2012-02-07 17:52 Dsp Tian 阅读(572) 评论(0) 推荐(0)
摘要: #include <iostream>#include <string>#include <boost/lexical_cast.hpp>using namespace std;using namespace boost;int main(){ string i; try { i=lexical_cast<string>(123.134); } catch(bad_lexical_cast&e) { cout<<e.what()<<endl; return 1; } cout<<i<<end 阅读全文
posted @ 2012-02-06 22:01 Dsp Tian 阅读(748) 评论(0) 推荐(0)
摘要: cl;img=imread('1.bmp');[m n]=size(img);imshow(img)imgn=img;temp=[];%开操作for i=2:m-1 %腐蚀 for j=2:n-1 temp=img(i-1:i+1,j-1:j+1); imgn(i,j)=min(temp(:)); endendfor i=2:m-1 %膨胀 for j=2:n-1 temp=img(i-1:i+1,j-1:j+1); imgn(i,j)=max(... 阅读全文
posted @ 2012-02-05 19:45 Dsp Tian 阅读(2278) 评论(0) 推荐(0)
摘要: cl;img_gray=imread('fupeng.jpg');img_erzhi=imread('erzhi_fupeng.jpg');imshow(img_gray)figure,imshow(img_erzhi)[m n]=size(img_gray);img_gray_fu=zeros(m,n);img_gray_peng=zeros(m,n);img_erzhi_fu=zeros(m,n);img_erzhi_peng=zeros(m,n);for i=2:m-1 for j=2:n-1 img_gray_fu(i,j)=min(min(img_gr 阅读全文
posted @ 2012-02-05 16:02 Dsp Tian 阅读(11991) 评论(0) 推荐(0)