將手機號轉化為由隨機字母表示

gavinlee發表於2008-01-22
static void Main(string[] args)
{
String word = "abcdefghijklmnopqrstuvwxyz";
for (int i = 0; i < 11; i++)
{
int a= getphone(getphone(i-1));
Console.Write(word.Substring(a,1));
}
}
//create random
static int getphone(int seed)
{
Random rand = new Random(seed);
int a = rand.Next(0, 25);
return a;
}[@more@]static void Main(string[] args)
{
String word = "abcdefghijklmnopqrstuvwxyz";
for (int i = 0; i < 11; i++)
{
int a= getphone(getphone(i-1));
Console.Write(word.Substring(a,1));
}
}
//create random
static int getphone(int seed)
{
Random rand = new Random(seed);
int a = rand.Next(0, 25);
return a;
}

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/310974/viewspace-998187/,如需轉載,請註明出處,否則將追究法律責任。

相關文章