文档详情

GIS程序设计第十一章.ppt

发布:2015-09-10约2.47万字共70页下载文档
文本预览下载声明
{ cout*strItBegin1″ ″; strItBegin1++; } cout endl; while(ptItBegin1!=ptItEnd1) //输出ptMyList1 { int static count=0; if(count==5) { count=0; coutendl; } ptItBegin1-display(); ptItBegin1++; count++; } cout endl; //分别输出用insert函数得到的新对象 while(nItBegin2!=nItEnd2) //输出nMyList2 (续) { cout*nItBegin2″ ″; nItBegin2++; } cout endl; while(dblItBegin2!=dblItEnd2) //输出dblMyLIst2 { cout*dblItBegin2″ ″; dblItBegin2++; } cout endl; while(cItEnd2!=cItBegin2) //输出cMyList2 { 0 cout*(--cItEnd2)″ ″; } cout endl; while(strItBegin2!=strItEnd2) //输出strMyList2 { (续) cout*strItBegin2″ ″; strItBegin2++; } cout endl; while(ptItBegin2!=ptItEnd2) //输出ptMyList2 { int static count=0; if(count==5) { count=0; coutendl; } ptItBegin2-display(); ptItBegin2++; count++; } cout endl; //从字符型list对象中弹出数据 for(i=0;i5;i++) { (续) cItEnd1=cMyList1.end(); cout″The Element will be pop is: ″*(--cItEnd1)endl; cMyList1.popback(); } cItEnd1=cMyList1.end(); cItBegin1=cMyList1.begin(); //输出弹出数据后的字符型list对象的数据 while(cItBegin1!=cItEnd1) { cout*cItBegin1″ ″; cItBegin1++; } cout endl; nItBegin1=nMyList1.begin(); nItEnd1 =nMyList1.end(); //用一个已经存在的list对象初始化另一个list对象 list int nMyList3(nItBegin1,nItEnd1); list int nMyList4(nMyList3); (续) //输出两个新的list对象 copy(nMyList3.begin(),nMyList3.end(),nOutput); cout endl; copy(nMyList4.begin(),nMyList4.end(),nOutput); cout endl; } //源程序结束 1 2 3 4 5 6 7 8 9 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 B C D E F G H I J K I Like C++! 1 2 3 4 5 6 7 8 9 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 B C D E F G H I J K I Like C++! Point(1,1) Point(2,2) Point(3,3) Point(4,4) Point(5,5) Point(6,6) Point(7,7) Point(8,8) Point(9,9) Point(10,10) (续) 1 2 3 4 5 6 7 8 9 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 B C D E F G H I J K I Like C++! Point(1,1) Point(2,2) Point(3,3) Point(4,4) Point(5,5) Point(6,6) Point(7,7) Point(8,8) Point(9,9) Point(10,10) The Element will be pop is: K The Element will be pop is:
显示全部
相似文档