Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
为什么我wa,我觉得没错啊#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator