1. int cmp(const void *x,const void *y) {return
*(int*)y-*(int*)x;}//非增序
qsort(a,n,sizeof(a[0]),cmp);//参数分别为(首位置,个数,大小,比较函数)(后续更新)2.int num=unique(a,....
分类:
其他好文 时间:
2014-05-10 05:29:43
阅读次数:
284
1/**2*数组乱序类3*@authornoam4*/5publicclassNRandom{67/**8*对给定数目的自0开始步长为1的数字序列进行乱序9*@paramno给定数目10*@return乱序后的数组11*/12publicstaticint[]getSequence(intno){1...
分类:
其他好文 时间:
2014-05-10 05:24:18
阅读次数:
243
int BubbleSort(int a[]){ int length =
sizeof(a)/sizeof(int); int i,j; int temp; for(i = 0;i i;j--) { if(a[j] <
a[j-1]) { ...
分类:
其他好文 时间:
2014-05-10 03:24:40
阅读次数:
233
转载void CTestDlg::DeleteDirectory(CString
strDir){ if(strDir.IsEmpty()) return; //首先删除文件及子文件夹 CFileFind ff; BOOL bFound =
ff...
分类:
其他好文 时间:
2014-05-10 03:01:13
阅读次数:
292
/** * 转换图片成圆形 * * @param bitmap * 传入Bitmap对象 *
@return */ public static Bitmap toRoundBitmap(Bitmap bitmap)...
分类:
移动开发 时间:
2014-05-10 02:46:10
阅读次数:
436
请编写程序,处理一个复数与一个double数相加的运算,结果存放在一个double型的变量d1中,输出d1的值,再以复数形式输出此值。定义Complex(复数)类,在成员函数中包含重载类型转换运算符:
operator double() { return real; }
Input
一个复数与一个double数
Output
d1的值和复数形式的此值
Sam...
分类:
其他好文 时间:
2014-05-09 22:30:21
阅读次数:
398
/**
*
* @param c
* for example Person.class
* @param primaryKeys
* primaryKeys为主键,参数顺序和表中保持一致 如果id, name 为主键 类名为Person 则 getEntity(Person.class,1,"name")
* @return
...
分类:
数据库 时间:
2014-05-09 21:15:10
阅读次数:
422
tableView 实现的方法 无分组的cell
#pragma mark - Table view data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.contacts.count;
}
- (UITable...
分类:
移动开发 时间:
2014-05-09 21:03:32
阅读次数:
424
N-Queens IThen-queens puzzle is the problem of
placingnqueens on ann×nchessboard such that no two queens attack each
other.Given an integern, return a...
分类:
其他好文 时间:
2014-05-09 20:34:01
阅读次数:
335
/*验证邮箱格式*/ function checkEmail(strEmail){
if(!/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/ .test(strEmail)){ return
false; } else ...
分类:
Web程序 时间:
2014-05-09 20:02:19
阅读次数:
482