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

为什么我wa,我觉得没错啊

Posted by foreverlin at 2009-07-19 18:15:23 on Problem 2469 and last updated at 2009-07-19 18:15:39
#include<iostream>
using namespace std;
int a[101][53];
int n;
void output(int x)
{
    int t,r;
    t=x/13;
    r=x%13+1;
    if(r>=1&&r<=9)printf("%d",r+1);
    if(r==10)printf("Jack");
    if(r==11)printf("Queen");  
    if(r==12)printf("King");
    if(r==13)printf("Ace");
    printf(" of ");
    if(t==0)printf("Clubs");
    if(t==1)printf("Diamonds");
    if(t==2)printf("Hearts");
    if(t==3)printf("Spades");
    printf("\n");
    }
int main()
{
    int i,j,k;
    while(scanf("%d",&n)!=EOF)
    {
          for(i=1;i<=52;i++)
          {
              a[0][i]=i;              
              }         
          for(i=1;i<=n;i++)
          {
              for(j=1;j<=52;j++)
              {             
                  scanf("%d",&k);
                  a[i][k]=a[i-1][j];
                  }             
              }
          scanf("%d",&k);
          for(i=1;i<=52;i++)
          {
              output(a[k][i]-1);              
              }                
          while(scanf("%d",&k)!=EOF)
          {
                printf("\n");                    
                for(i=1;i<=52;i++)
                {
                    output(a[k][i]-1);              
                    }                        
                }                 
          }
    return 0;
    }


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