#includeswap(int *p1, int *p2){ int temp; temp = *p1; *p1 = *p2; *p2 = temp;}exchange(int *ep1, int *ep2, int *ep3){ ...
分类:
其他好文 时间:
2014-08-01 13:14:51
阅读次数:
246
1 #pragma mark 冒泡排序 2 - (void)userArrSort:(NSMutableArray *)userArr 3 { 4 int n = userArr.count; 5 int i,j; 6 NSDictionary *temp; 7 f...
分类:
其他好文 时间:
2014-08-01 12:54:01
阅读次数:
262
#include #include int* fun(int* a){ std::cout << *a << std::endl;//这样有问题吗???? int temp = 100; return &temp;//这个是典型的错误}int main(){ int a = ...
分类:
其他好文 时间:
2014-08-01 04:52:58
阅读次数:
178
0; $i--){ $flag = 0; //每一趟进行相邻两个数进行比较 for($j = 0; $j $arr[$j+1]){ $temp = $arr[$j]; $arr[$j] = $arr[$j+1]; $arr[$j+1] =$temp; $flag = 1...
分类:
Web程序 时间:
2014-07-31 20:38:57
阅读次数:
197
用法./change 23456 10, 按最后指定的进制显示
#include
#include
#include
int mystrlen(char *s)
{
int len=0;
char *temp=s;
while(*(temp)!='\0')
{
++len;
++temp;
}
return le...
分类:
其他好文 时间:
2014-07-31 16:57:06
阅读次数:
224
1、冒泡法排序class Program{//冒泡法排序public static void sort(int[] list){int i, j, temp;j = 1;while (j list[i + 1]){temp = list[i];list[i] = list[i + 1];list[....
分类:
其他好文 时间:
2014-07-31 13:00:46
阅读次数:
152
Template Parameter
#include
#include
#include
#include
#include
#include
using namespace std;
template
Foo calc(const Foo &a, const Foo &b)
{
Foo temp=a;
//...
return temp;
}
///Templa...
分类:
编程语言 时间:
2014-07-31 09:55:46
阅读次数:
252
//算法:获得无小数点的输入串,然后对该串进行普通的高精度乘法运算
//运算得到结果后,添加小数点,最后除去串头和串尾的0即可
#include
#define MAXN 200
char R[10];
char E[6];//寄存无小数点的输入串
char temp[MAXN];
char ans[MAXN];//寄存答案串
int n,left;
void multip();
int ...
分类:
其他好文 时间:
2014-07-31 00:08:15
阅读次数:
269
直接递归
代码:
#include
#include
using namespace std;
typedef struct listNode{
int key;
struct listNode *pNext;
} * pNode,Node;
void createNode(pNode &pHead){
bool isFirst=true;
int temp;
sc...
分类:
其他好文 时间:
2014-07-30 20:57:14
阅读次数:
174
这道题目,算数学题吗?算二分题吗?充其量算个水题吧...
首先,没有用二分,但是发现了一种新的解法来代替二分。
若果按照i从0,每次增加0.00000001来一直枚举到h的话,绝逼超时。枚举量太大了
但是可以分成两步来呀:
#include
#include
#define pai acos(-1.0)
double r1,r2,h,v;
double get_v(double temp...
分类:
其他好文 时间:
2014-07-30 17:43:14
阅读次数:
208