转自 http://www.cnblogs.com/BeginMan/archive/2013/06/08/3125876.html 一、标准类型函数 cmp():比较大小 str():转换为字符串 type():类型 cmp(...) cmp(x, y) -> integer Return neg ...
分类:
编程语言 时间:
2017-03-26 16:22:13
阅读次数:
196
剑指offer-把数组排成最小的数 题目描述 输入一个正整数数组,把数组里所有数字拼接起来排成一个数,打印能拼接出的所有数字中最小的一个。例如输入数组{3,32,321},则打印出这三个数字能排成的最小数字为321323。 题解: 利用sort函数的cmp功能,实现将组合成的数字最小到最大的方式排列 ...
分类:
编程语言 时间:
2017-03-23 22:28:01
阅读次数:
173
#include #include #include using namespace std; struct Node { int c0; int c1; int m; }com[1001]; bool cmp(Node a,Node b) { if (a.m!=b.m) return a.m>b.... ...
分类:
其他好文 时间:
2017-03-15 11:31:11
阅读次数:
145
#include<iostream>#include<string>#include<algorithm>using namespace std;int cmp(string a,string b){ return a+b>b+a; }int main(){ int n; while(scanf(" ...
分类:
其他好文 时间:
2017-03-10 20:47:27
阅读次数:
110
1 #include 2 #include 3 #include 4 using namespace std; 5 6 struct cmp 7 { 8 bool operator()( const int &a, const int &b ) 9 { 10 return a , greater >... ...
分类:
其他好文 时间:
2017-03-08 22:48:41
阅读次数:
209
1 #include <bits/stdc++.h> 2 #define _xx ios_base::sync_with_stdio(0);cin.tie(0); 3 using namespace std; 4 typedef long long ll; 5 ll a, b; 6 bool cmp ...
分类:
其他好文 时间:
2017-02-26 19:26:46
阅读次数:
152
转载于:http://blog.csdn.net/tjpuacm/article/details/26389441 不加比较函数的情况: [cpp] view plain copy int a[]={0,1,2,2,3}; printf("%d\n",lower_bound(a,a+5,2,cmp) ...
分类:
编程语言 时间:
2017-02-22 13:15:54
阅读次数:
251
#include<bits/stdc++.h>包含了目前c++所包含的所有头文件!!!!开挂般的奇迹人生 while(scanf("%d",&n)!=EOF) qsort函数qsort(a,n+m,sizeof(a[0]),cmp);int cmp(void const *a,void const ...
分类:
其他好文 时间:
2017-02-20 19:45:48
阅读次数:
129
EJB有两种主要类型BMP(Bean managed persistence )和CMP(Container managed persistence ),这两种类型各有优缺点。 BMP是在Bean中完成对数据库JDBC的各种调用,也就是说,在你的实体bean(entity bean)中,明确写入了S ...
分类:
其他好文 时间:
2017-02-18 23:07:13
阅读次数:
355
#include #include using namespace std; struct node{ double num; double price; double weight; }; int cmp(const void *a, const void *b){ node aa = *(nod... ...
分类:
其他好文 时间:
2017-01-21 19:37:16
阅读次数:
324