猿问

大神们,怎样改进这个程序,让他更好显示,自由发挥即可

#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>
enum suits{CLUBS,DIAMONDS,HEARTS,SPADES};
struct card
{
	enum suits suit;
	char value[3];
};
struct card deck[52];
char cardval[][3]={"A","2","3","4","5","6","7","8","9","10","J","Q","K"};
char suitsname[][9]={"CLUBS","DIAMONDS","HEARTS","SPADES"};
void main()
{
	int i,j;
	enum suits s;
	system("cls");
	for(i=0;i<=12;i++)
		for(s=CLUBS;s<=SPADES;s++)
		{
			j=i*4+s;
			deck[j].suit=s;
			strcpy(deck[j].value,cardval[i]);
		}
	for(j=0;j<52;j++)
printf("(%s%3s)%c",suitsname[deck[j].suit],deck[j].value,j%4==3?'\n':'\t');
		getch();
}


qq_卷氺墨留苩_04197741
浏览 1066回答 0
0回答
随时随地看视频慕课网APP
我要回答