编程语言
操纵符在头文件iomanip中 #include #include using namespace std; int main(){ int i=4,j=6,k=8; char c1='!'; //endl的使用 cout<<i<<c1<<endl <<j<<c1<<'\n' <<k<<c1<<endl; i=91; //不同进制的输出 cout<<"i= "<<i <<...
分类:编程语言 时间:2014-02-23 18:01:45 收藏:0 阅读:480
输入文件被看作输入流 输出文件被看作输出流 进行文件操作需包含头文件fstream //this program repeatedly reads an income from //the file incom.in until end-of file. //Income under 6000 greenbacks is taxed at 30 percent, //and income g...
分类:编程语言 时间:2014-02-23 18:17:51 收藏:0 阅读:497
#include using namespace std; const int* find(int val,const int* t, int n); int main(){ int a[]={2, 4, 6}; int* ptr;//不是const类型 ptr=const_cast(find(4, a, 3));//去掉const类型 if(ptr == 0) cout<<...
分类:编程语言 时间:2014-02-23 17:37:42 收藏:0 阅读:1725
#include using namespace std; int main(){ int i; float f=-6.9072; //将float指针转换为字符指针 unsigned char* p=reinterpret_cast(&f); cout<<hex;//print bytes of f in hex for(i=0; i<sizeof(float);i++) ...
分类:编程语言 时间:2014-02-23 17:56:26 收藏:0 阅读:504
首先了解下CodeEval是做什么的:A tool for auto evaluating programming challenges in C/C++/Java/Python/Ruby/PHP/Perl/ Scala/Clojure/C#/Tcl/JavaScript/ Haskell/Go/B...
分类:编程语言 时间:2014-02-23 17:29:31 收藏:0 阅读:478
c++多行字符串,可以这么写:CString s;s.Format("CREATE TABLE %s(\[ID] [int] IDENTITY(1,1) NOT NULL,\[Vendor] [varchar](10) NULL,\[System] [varchar](4) NULL,\[FileT...
分类:编程语言 时间:2014-02-23 15:21:57 收藏:0 阅读:436
在编写程序时可能会出现一些异常,比如类型错误,除零错误等,为了能捕获并处理这些异常,可以使用python的异常处理功能。python使用raise语句可以抛出异常,对于可能出现异常的语句块,用try语句包围起来,并用except捕捉,就可以实现异常处理了,比如: x=input("first number:") y=input("second number:") try: print x/...
分类:编程语言 时间:2014-02-23 14:55:15 收藏:0 阅读:380
multiset与set一样,也是使用红黑树来组织元素数据的,唯一不同的是,multiset允许重复的元素键值插入,而set则不允许;   multiset也需要声明头文件#include .由于它包含重复元素,所以,在插入元素,删除元素,查找元素上和set也有差别; multiset元素的插入 下例程序插入了重复值123,最后中序遍历了multiset对象; 运...
分类:编程语言 时间:2014-02-23 14:53:59 收藏:0 阅读:485
当一个服务器需要与多个客户端进行通信时,可以使用多进程或者多线程的服务器,也可以使用select模块,它可以实现异步通信。Python中的select模块包含了poll()和select(),select的原型为(rlist,wlist,xlist[,timeout]),其中rlist是等待读取的对象,wlist是等待写入的对象,xlist是等待异常的对象,最后一个是可选对象,指定等待的时间,单位...
分类:编程语言 时间:2014-02-23 13:51:03 收藏:0 阅读:466
在我们的代码里经常会和列表,元组,字典等数据结构打交道,可以这么说,在很大程度上我们的代码就是对这些数据结构进行处理的过程,在Python中对列表,元组,字典等内置的数据结构的处理是很方便的事情,python借鉴了Lisp中的很多函数式计算的方法来处理列表,可以极大的简化我们的代码。set() 将元...
分类:编程语言 时间:2014-02-23 13:01:09 收藏:0 阅读:408
151164511655116651284
上一页512833下一页
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!