在C#中,ref的意思是按引用传递。可以参考C++:inta=10,b=20; voidswap(intx,inty) { inttemp=x; x=y; y=temp; }如果简单的调用这个swap,比如:swap(a, b),那么你根本没办法交换这两个变量的值,因为x和y都是形参,在swap返回...
const char* strstr(const char *str, const char* substr){ int i, j, temp; for (i = 0; str[i] != '\0'; i++) { j = 0; temp = i; //...
分类:
其他好文 时间:
2015-07-19 21:23:44
阅读次数:
103
实时天气:city"北京"//城市cityid"101010100"//城市编码temp"17"//当前温度WD"东风"//风向WS"2级"//风力SD"70%"//相对湿度WSE"2"//风力time"14:20"//更新时间isRadar"1"//是否有雷达图Radar"JC_RADAR_AZ9...
分类:
Web程序 时间:
2015-07-19 19:39:10
阅读次数:
259
#include #define SWAP1(a,b) \{ \ int temp = a; \ a = b; \ b = temp; \}#define SWAP2(a,b) \{ \...
分类:
其他好文 时间:
2015-07-19 17:42:50
阅读次数:
92
public class StraightInsertionSort { public static void Sort(int[] array) { for (int i = 1; i = 0 && temp < array[j]; j--)...
分类:
编程语言 时间:
2015-07-19 11:44:42
阅读次数:
137
har数组要转换成string可没想象的那么容易。需要使用到System.Text.StringBuilder!实例如下:char[] temp={a,b,c};System.Text.StringBuildersb =newSystem.Text.StringBuilder();sb.Append...
//不管怎么样还是希望天天做笔记把,真是太懒了#include#include#include#includeusing namespace std;vectors[2160001]; int main(){ int t; for(int i=0;i2160000)temp=4...
分类:
其他好文 时间:
2015-07-18 22:33:31
阅读次数:
98
题意:一个含n个数的区间(n#include#include#includeusing namespace std;int add[5000100],num[5000100];int pos[5000100],b[5000100];int t,n,m,block,temp;char str[5050...
分类:
其他好文 时间:
2015-07-18 16:56:03
阅读次数:
84
当打开Unity时 提示项目已经打开,而自己之前并没有打开过(可能之前异常关闭)发生这种情况时 打开项目目录中的 Temp文件夹,可以找到 一个UnityLockfile 文件将这个文件删除就可以正常打开了
分类:
编程语言 时间:
2015-07-18 16:50:26
阅读次数:
130
基本思想首先第一个元素和第二个元素比较,如果第一个大,则二者交换,否则不交换;然后第二个元素和第三个元素比较,如果第二个大,则二者交换,否则不交换……一直按这种方式进行下去,最终最大的那个元素被交换到了最后,一趟冒泡排序完成。代码public void BubbleSort(int[] a, int n) {
int temp;
for (int i = 1; i < n; i++)...
分类:
编程语言 时间:
2015-07-18 11:07:03
阅读次数:
142