程序运行出现问题
编译没有问题,运行出错了,麻烦帮我看看是什么问题,谢谢#include <iostream>
#include <cstdlib>
#include <ctime>
#include <iomanip>
void shaffle(int [][13]);
void deal(const int [][13],const char *[],const char *[]);
using namespace std;
int main()
{
const char *suit[4]={"Hearts","Diamonds","Clubs","Spades"};
const char *face[13]={"Ace","Deuce","There","Four","Five",
"Six","Seven","Eight","Nine","Ten","Jack",
"Queue","King"};
int deck[4][13]={0};
shaffle(deck);
deal(deck,suit,face);
srand(time(0));
return 0;
}
void shaffle(int wdeck[][13])
{
int row,column;
for(int card=1;card<=52;card++)
{
do
{
row=rand()%4;
column=rand()%13;
}
while(wdeck[row][column]!=0);
wdeck[row][column]=card;
}
}
void deal(int wdeck[][13],char *wsuit[],char *wface[])
{
for(int card=1;card<=52;card++)
{
for(int row=0;row<4;row++)
{
for(int column=0;column<13;column++)
{
if(wdeck[row][column]==card)
{
cout<<setw(5)<<wface[column]
<<setw(8)<<wsuit[row]
<<(card%2==0?'\n':'\t');
}
}
}
}
}