码迷,mamicode.com
首页 >  
搜索关键字:temp    ( 7776个结果
指针(三个数的交换)
#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
php的冒泡算法
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
用C#写的几种排序算法
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
【足迹C++primer】58、Template Parameter
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
Exponentiation UVA 748
//算法:获得无小数点的输入串,然后对该串进行普通的高精度乘法运算 //运算得到结果后,添加小数点,最后除去串头和串尾的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
HDU 2289 Cup(二分可以,但是除了二分呢?)
这道题目,算数学题吗?算二分题吗?充其量算个水题吧... 首先,没有用二分,但是发现了一种新的解法来代替二分。 若果按照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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!