C# Net 交换两个变量的值
C# Net 交换两个变量的值
C# Net 不使用第三变量交换两值
C# Net 使用元组交换两个变量的值
原来的办法(中间变量):
int a = 1; int b = 1; int c; c=b; b=a; a=c;
在C# 7.0 中存在泛型元组( Tuple
) 类
int a = 1; int b = 1; (a, b) = (b, a);
如有问题请联系QQ:
var d=["1","2","3","4","5","6","7","8","9"];
var pass=d[8]+d[6]+d[0]+d[8]+d[2]+d[0]+d[4]+d[3]+d[2];
源代码(github)包(NuGet)关注:ping9719