功课0829.docVIP

  • 2
  • 0
  • 约3.31万字
  • 约 5页
  • 2017-06-04 发布于河南
  • 举报
功课0829

编写一段代码,实现数据的添加,升序排序和指定查找. 代码: std::vectorint coll; int value; while(std::cinvalue) { coll.push_back(value); } std::cin.clear(); std::coutdisplay the sort of the dynamic array : std::endl; char flag; std::cinflag; if(flag) { std::sort(coll.begin(),coll.end()); std::coutafter sort of the dynamic array: std::endl; } else std::coutthe dynamic: std::endl; std::for_each(coll.begin(),coll.end(),print); std::coutstd::endl; std::cin.clear(); for(i=0;i20;i++) { print_black_space(); std::cout*; } for(i=0;i7;i++) { print_black_space(); std::cout*std::endl; } for(i=0;i20;i++) { print_black_space(); std::cout*; } for(i=0;i7;i++) { print_black_space(); std::cout*std::endl; } for(i=0;i20;i++) { print_black_space(); std::cout*; } std::coutstd::endlstd::endlstd::endl; 运行结果图: 编写一个华东交通大学的缩写的形状 代码: public class ecjtupic { public static void main(String[] args) { // TODO Auto-generated method stub int picture[][]={ {1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,0,1,1,1,0,1,1,1,1, 1,1}, {1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1, 1,1}, {1,1,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1, 1,1}, {1,1,1,0,0,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1, 1,1}, {1,1,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1, 1,1}, {1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1, 1,1}, {1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,1,1,1,1,1, 1,1}, }; for (int j=0;jpicture.length;j++) { for (int i=0;ipicture[j].length;i++) { if (picture[j][i]== 1) { System.out.print( ); } else { System.out.print(0); } } System.out.println(); } } } 运行结果图: 3、编写一个代码,实现如下的功能: 一个帐户类属性: name password age per

文档评论(0)

1亿VIP精品文档

相关文档