1 #include <cstdio> 2 const int N = 54; 3 char Color[5] = {‘S‘, ‘H‘, ‘C‘, ‘D‘, ‘J‘}; 4 int start[N+1], trans[N+1], end[N+1]; 5 int main() { 6 int n; 7 scanf("%d",&n); 8 for(int i = 1; i <= N; i++){ 9 start[i] = i; 10 } 11 for(int i = 1; i <= N; i++){ 12 scanf("%d",&trans[i]); 13 } 14 for(int step = 0; step < n; step++){ 15 for(int i = 1; i <= N; i++){ 16 end[trans[i]] = start[i]; 17 } 18 for(int i = 1; i <= N; i++){ 19 start[i] = end[i]; 20 } 21 } 22 for(int i = 1; i <=N; i++){ 23 if(i != 1) 24 printf(" "); 25 start[i]--; 26 printf("%c%d",Color[start[i]/13],start[i]%13+1); 27 } 28 return 0; 29 }
原文地址:https://www.cnblogs.com/zjsaipplp/p/10415748.html
时间: 2024-10-02 10:49:02