Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

不行了,,,,晕头了,

Posted by Essence_me at 2005-08-09 18:12:53 on Problem 2469
In Reply To:疯了,,多余的空格空行? Posted by:Essence_me at 2005-08-09 18:02:59
#include <stdio.h>
int card[52],card1[52],order[100][52];
void main()
{
	int n,i,j,m1,m2;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		for(j=0;j<52;j++)
		{
			scanf("%d",&order[i][j]);
			order[i][j]--;
		}
	}
	for(i=0;i<52;i++)
	{
		card1[i]=i;
	}
	while(scanf("%d",&n)!=EOF)
	{
		n--;
		for(i=0;i<52;i++)
			card[order[n][i]]=card1[i];
		for(i=0;i<52;i++)
		{
			m1=card[i]/13;
			m2=card[i]%13;
			switch(m2)
			{
				case 0:printf("2 ");break;
                                case 1:printf("3 ");break;
				case 2:printf("4 ");break;
				case 3:printf("5 ");break;
				case 4:printf("6 ");break;
				case 5:printf("7 ");break;
				case 6:printf("8 ");break;
				case 7:printf("9 ");break;
				case 8:printf("10 ");break;
				case 9:printf("Jack ");break;
				case 10:printf("Queen ");break;
				case 11:printf("King ");break;	
				case 12:printf("Ace ");break;
			}
			printf("of ");
			switch(m1)
			{
				case 0:printf("Clubs\n");break;
				case 1:printf("Diamonds\n");break;
				case 2:printf("Hearts\n");break;
				case 3:printf("Spades\n");break;
			}
		}
		for(i=0;i<52;i++)
		{
			card1[i]=card[i];
		}
		printf("\n");
	}
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator