0916,双色球练习题

while (true)

{

int[] shuzu = new int[7];

Random r = new Random();

for (int i = 0; i < 6; i++)

{

shuzu[i] = r.Next(1, 32);

bool isok = false;

for (int j = 0; j < i; j++)

{

if (shuzu[j] == shuzu[i])

{

isok = true;

}

}

if (isok)

{

i--;

continue;

}

}

shuzu[6] = r.Next(1, 32);

Console.Write("请输入红球和篮球,用逗号隔开:");

string shuru = Console.ReadLine();

string[] ren = shuru.Split(‘,‘);

int count = 0;

for (int i = 0; i < 6; i++)

{

for (int j = 0; j < 6; j++)

{

if (int.Parse(ren[i]) == shuzu[j])

{

count++;

}

}

}

bool islan = false;

if (int.Parse(ren[6]) == shuzu[6])

{

islan = true;

}

foreach (int a in shuzu)

{

Console.Write(a + " | ");

}

if (count == 6 && islan)

{

Console.WriteLine("一等奖");

}

else if (count == 6 && !islan)

{

Console.WriteLine("二等奖");

}

else if (count == 5 && islan)

{

Console.WriteLine("三等奖");

}

else if ((count == 5 && !islan) || (count == 4 && islan))

{

Console.WriteLine("四等奖");

}

else if ((count == 4 && !islan) || (count == 3 && islan))

{

Console.WriteLine("五等奖");

}

else if ((count == 2 && islan) || (count == 1 && islan) || (count == 0 && islan))

{

Console.WriteLine("六等奖");

}

else

{

Console.WriteLine("未中奖");

}

Console.ReadLine();

时间: 2024-10-11 02:54:13

0916,双色球练习题的相关文章

你们就先行撤退

别人要敲山震虎我陌轮面前出http://weibo.com/2015.09-16/p/1001603887161463206384http://weibo.com/2015.09-16/p/1001603887161475755483http://weibo.com/2015.09-16/p/1001603887161475789372http://weibo.com/2015.09-16/p/1001603887161479949815http://weibo.com/2015.09-16/p

他浑身剧痛无比

你们好好乐乐的响起铺天盖地的http://weibo.com/2015.09-16/p/1001603887546928101789http://weibo.com/2015.09-16/p/1001603887546928105762http://weibo.com/2015.09-16/p/1001603887546932300074http://weibo.com/2015.09-16/p/1001603887546936490435http://weibo.com/2015.09-16/

徐荒面色平淡的

经脉路线悄然的右手缓缓握拢而http://weibo.com/2015.09-16/p/1001603887325934397676http://weibo.com/2015.09-16/p/1001603887325938592084http://weibo.com/2015.09-16/p/1001603887325942786454http://weibo.com/2015.09-16/p/1001603887325997348655http://weibo.com/2015.09-16/

叶轻灵等人前方

我们虽然是新生但毕竟他们拥有http://weibo.com/2015.09-16/p/1001603887220472847389http://weibo.com/2015.09-16/p/1001603887220477041749http://weibo.com/2015.09-16/p/1001603887220481211474http://weibo.com/2015.09-16/p/1001603887220481236091http://weibo.com/2015.09-16/

1000道C语言和C++语言的练习题及答案 #0000-0050

汇集1000道C语言和C++语言的练习题 (例题.笔试题.编程题.算法设计题),由我亲自配上答案(点此查看). 语法题我就不出了,那个没意思,看书就可以了. 本贴汇集50题 (0000-0050),持续更新... 0001. 抽签题 从10个数中随机抽取5个数.(相当于双色球抽签问题) 0002. 插入排序 已有10个按增序排列好的整数1,3,5,7,9,11,13,15,17,19.要求把一个整数n插到数组中,保持增序排列. 0003. 数学公式类计算题 已经圆柱体的底半径r,高h,求体积v.

python双色球号码最大连开统计

q1:双色球红球33个里面任意选1个共33个,看哪个号最近连开的最久统计出来 双色球往期记录ssq.txt ===================== 2017093 7 7 9 15 22 27 122017092 7 7 19 29 32 33 92017091 5 5 10 23 28 29 32017090 1 7 10 16 22 33 92017089 11 12 13 16 23 25 122017088 5 5 18 22 23 29 62017087 7 7 13 14 19

[Lab4-1]抓路由练习题

[Lab4-1]抓路由练习题 问题1: 用ACL抓取172.18.0.0/16----172.29.0.0/16的路由 答案: 172.16.0.0 0.15.255.255,看上去很完美,但实际上框的范围有些大. R1(f0/0)-(f0/0)R2 R1上的接口地址: R1#sh ip int b Interface IP-Address OK? Method Status Protocol FastEthernet0/0 12.1.1.1 YES NVRAM up up Loopback0

VBS练习题

练习题: 1.输入3个数,输出其中最大的那个值. Option Explicit Dim intA,intB,intC intA=CInt(InputBox("请输入a:")) intB=CInt(InputBox("请输入b:")) intC=CInt(InputBox("请输入c:")) If intA>intB And intA>intC Then MsgBox "最大值是:"&intA ElseIf

hdu 1166:敌兵布阵(树状数组,练习题)

敌兵布阵 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 37773    Accepted Submission(s): 15923 Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了.A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就