码迷,mamicode.com
首页 >  
搜索关键字:循环 if for while case    ( 74454个结果
c++ 快速排序
介绍给大家一个快速排序的方法: void sort(int  a[ ], int l, int r) { int i = l; int j = r; int mid = a[(i+j)/2];      do   {         while(a[i] while(a[j] >mid ) j--; if( i { swap( a[i], a[j] ); }...
分类:编程语言   时间:2014-06-20 13:15:03    阅读次数:292
C语言学习_排序_插入排序
1.插入排序 #include #include #define M 100 int main(void) { int i, j, n; int a[M] = {0}; printf("input n:"); scanf("%d", &n); printf("input a:"); for(i = 1; i scanf("%d", &a[i]); ...
分类:编程语言   时间:2014-06-20 11:00:54    阅读次数:230
二叉树先序中序非递归算法
一直想要写的 二叉树 中序 先序 后序遍历算法 递归的太简单了,就不写了。关键是非递归版本。 先序: 我自己的版本: void RootPreTraverse(Node* p) { Stack S; while(S not empty) { p=S.top(); S.pop(); Show(p); if(p->right!=null) S...
分类:其他好文   时间:2014-06-20 10:55:49    阅读次数:279
Java集合01----ArrayList的遍历方式及应用
Java集合01----ArrayList的遍历方式及应用 1.ArrayList的遍历方式 a.一般for循环(随机访问) Integer value = null; int size = list.size(); for (int i=0; i<size; i++) { value = (Integer)list.get(i); } b.增强型for循环(for...
分类:编程语言   时间:2014-06-20 10:22:41    阅读次数:240
LigerUi-Js中Grid行修改时,不执行保存事件的原因?(已解决)
LigerUi-Js中Grid行修改时,不执行保存事件的原因?(已解决) (1) (2)下面代码写在grid上面 function itemclick1(item) { var editingrow = grid.getEditingRow(); switch (item.text) { case "增加": ...
分类:Web程序   时间:2014-06-20 09:40:01    阅读次数:425
十五周 项目1 工资数据的输入
/* 输入员工工资1000-10000之间,并按从大到小输出*/ #include using namespace std; int main( ) { double salarys[500]; int n=0; double t; while(cin>>salarys[n]) { n++; //从cin流读取数据 ...
分类:其他好文   时间:2014-06-07 15:36:38    阅读次数:191
利用jsonrpc技术包装uiautomator
uiautomator神工具 虽然没找到解决的方法,但是让我无意中发现了一个好工具,比sl4a更好用的工具,直接包装uiautomator,调用uiautomator的api在本地直接编写脚本,然后运行测试case,这样比用java写,然后再打包,runcase要简单的多,关键是他...
分类:Web程序   时间:2014-06-07 15:30:08    阅读次数:698
关于c++primer的一个代码错误
最近看c++primer第四版的标准容器vector,讲到对vector容器的插入删除元素会使得end()的迭代器失效的问题,所以不建议程序员对end()的存储。 vector vec; vector::iterator first=vec.begin(); while(first!=vec.end()) { first=vec.insert(first,12); first...
分类:编程语言   时间:2014-06-07 13:04:13    阅读次数:230
sql中的CHARINDEX和临时表
update #temp set #temp.Recycle=case when UnionA.num>0 then 1 else 0 end from (select GradeID,sum(num)as num from AreaAllot      where CHARINDEX(@Area,AreaAllot.Area)=1 and LEN(@Area)=LEN(Area)-2 ...
分类:数据库   时间:2014-06-07 12:57:44    阅读次数:304
ORACLE11.2.0 SQLPLUS 报 error while loading shared libraries
在vm下redhat5下安装oracle 11g后,登录sqlplus 报: sqlplus: error while loading shared libraries: /home/oracle/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc:...
分类:数据库   时间:2014-06-07 12:00:29    阅读次数:303
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!