摘要: 1 #includeiostream> 2 #includestring> 3 #includemap> 4 using namespace std; 5 int main() { 6 int n; 7 while(cin>>n) { 8 if(n==0) break; 9 string... 阅读全文
posted @ 2011-04-28 22:53 左手写诗 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 年前有个学生困扰于求职,我有幸和她聊了聊,她的困扰就是父母的期望与自己的选择有很大差异,很纠结。她希望能做自己想要的工作,但这种工作可能在别人眼里不光鲜,不像公务员工作会让别人眼里放光:)她的父母就是希望她能找到一份稳定而光鲜的工作,如什么公务员、教师、500强外企之类的工作,而且她的父母总是拿别... 阅读全文
posted @ 2011-04-27 08:54 左手写诗 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 1 class X { 2 private: 3 int m; 4 } // 声明X类 5 /* 类的作用域 */ 6 /*-----------------------访问数据成员---------------------*/ 7 X x; // 定义x对象 8 x.m ; // 访问对象成员 9 X::m; // 访问类的静态成员10 ptr->m; // ptr是指向类X的一个对象的指针,可访问数据成员11 12 // 如果对象的生存期与函数的运行期相同,则称它具有静态生存期:13 static int i; // 局部作用域中静态变量的特点是他不会随着函数的每次调用而产生一个副本 阅读全文
posted @ 2011-04-25 23:39 左手写诗 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 在Delphi6以上的版本中,有一个IdIPWatch控件,它的功能就是检测网络在线状态和获取 IP地址。而在以前的Delphi版本中却要采取另一种方法来获取IP,就是利用winsock单元的 一些网络函数的办法,这里不多说了,我们选择容易的。 新建一工程,在form1中添加控件edit1和bu... 阅读全文
posted @ 2011-04-19 16:02 左手写诗 阅读(2287) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 using namespace std; 3 int main() { 4 int n; 5 cin>>n; 6 for(int i=0;i<n;i++) { 7 int a[1200]={0},b[1200]={0},c[1200]={0},al,bl,k; 8 char aa[1200],bb[1200]; 9 cin>>aa>>bb;10 al=strlen(aa);11 bl=strlen(bb);12 for(int i1=0;i1<al;i1++) 13 a[i1]=aa[al 阅读全文
posted @ 2011-04-18 09:26 左手写诗 阅读(191) 评论(0) 推荐(0) 编辑
摘要: "=========================================================================" DesCRiption: 适合自己使用的vimrc文件,for Linux/Windows, GUI/Console"" Last Change:... 阅读全文
posted @ 2011-04-16 21:46 左手写诗 阅读(20831) 评论(0) 推荐(2) 编辑
摘要: 1 #includeiostream> 2 #includecmath> //sqrt()函数的头文件;c++的类应当先定义后使用,在两个类互相引用时(循环依赖),可用前向引用声明:class ***; 3 using namespace std; 4 class Point { 5 publ... 阅读全文
posted @ 2011-04-16 00:19 左手写诗 阅读(1254) 评论(0) 推荐(1) 编辑
摘要: C++通过引进四个新的类型转换操作符克服了C风格类型转换的缺点,这四个操作符是, static_cast, const_cast, dynamic_cast, 和reinterpret_cast。例如,假设你想把一个int转换成double,以便让包含int类型变量的表达式产生出浮点数值的... 阅读全文
posted @ 2011-04-16 00:05 左手写诗 阅读(243) 评论(0) 推荐(1) 编辑
摘要: 1 #includeiostream> 2 using namespace std; 3 class Point { 4 public: 5 Point(int xx=0,int yy=0) { 6 x=xx; 7 y=yy; 8 } 9 /*------------------复制构... 阅读全文
posted @ 2011-04-15 22:49 左手写诗 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 using namespace std; 3 int main() { 4 int n,u,d; 5 while(true){ 6 cin>>n>>u>>d; 7 if(n==0) 8 break; 9 else {10 int tem=0,v=0;11 tem=n-u;12 v=u-d;13 if(tem%v!=0) {14 int a=0;15 a=tem/v;16 cout<<2*(a+1)+1<<endl;17 continue;18 }19 else {20 int 阅读全文
posted @ 2011-04-15 17:24 左手写诗 阅读(152) 评论(0) 推荐(0) 编辑