using System;
using Ch10CardLib;
namespace Exercise_Answers
{
class Class1
{
static void Main(string[] args)
{
while(true)
{
Deck playDeck = new Deck();
playDeck.Shuffle();
bool isFlush = false;
int flushHandIndex = 0;
for (int hand = 0; hand < 10; hand++)
{
isFlush = true;
Suit flushSuit = playDeck.GetCard(hand * 5).suit;
for (int card = 1; card < 5; card++)
{
if (playDeck.GetCard(hand * 5 + card).suit != flushSuit)
{
isFlush = false;
}
}
if (isFlush)
{
flushHandIndex = hand * 5;
break;
}
}
if (isFlush)
{
Console.WriteLine("Flush!");
for (int card = 0; card < 5; card++)
{
Console.WriteLine(playDeck.GetCard(flushHandIndex + card));
}
}
else
{
Console.WriteLine("No flush.");
}
Console.ReadLine();
}
}
}
}
C#入门经典课后10.8练习中的第四题我不懂.以上红的地方都不懂.
高手能一步一步和我说一下..