看别人帖子,才发现的,挺有趣的,分享下
public class Program
{public static void Main(String[] args)
{
int[] arr = new int[] { 2, 7, 3, 5, 6, 0, 9, 8 };
int[] index = new int[] { 2, 5, 3, 1, 3, 0, 5, 4, 3 };
String q = "";
for (int i = 0; i < index.Length; i++)
{
q += arr[index[i]];
}
Console.WriteLine("得到的QQ号为:{0}", q);
int[] a = new int[] { 7, 3, 1, 0, 5, 9 };
int[] b = new int[] { 2, 4, 2, 1, 4, 4, 0, 5, 0, 2, 4 };
String tel = "";
for (int j = 0; j < b.Length; j++)
{
tel += a[b[j]];
}
Console.WriteLine("得到的手机号为:{0}", tel);
Console.Read();
}
}