The third session of Blue Bridge Cup Javac Group _ poker Move

Source: Internet
Author: User

/* (Start of program header comment)

* Copyright and version Declaration section of the program

* Copyright (c) 2016, Guangzhou Science and Technology Trade Vocational College, Department of Information Engineering students

* All rights reserved.

* File name: Blue Bridge Cup title

* Author: Pengjunhau

* Completion Date: April 01, 2016

* Version number: 001

* Description part of task and solution method

* Input Description:

* Description of the problem:

The following code simulates a set of poker (initial sort a~k, a total of 13 photos) of the operation process.

The operation process is:
Take this set of cards in your hand, take one from the front, put it in the back, take one from the front, put it on the table, and take a picture from the front.
Put it in the back, ....
This cycle is done until the last card remaining is placed on the table.

The purpose of the code below is to find out the order of the cards on the last table.

If the initial arrangement is A,2,3...K, the order on the last table is:
[2, 4, 6, 8, ten, Q, A, 5, 9, K, 7, 3, J]

Import java.util.*;
public class A23
{
public static list Movecard (list src)
{
if (src==null) return null;

List DST = new Vector ();
for (;;)
{
if (__________________) break; Blanks
Src.add (src.remove (0));
Dst.add (__________________); Blanks
}

return DST;
}

public static void Main (string[] args)
{
List a = new Vector ();
A.addall (Arrays.aslist ("A", "2", "3", "4", "5", "6", "7", "8", "9", "Ten", "J", "Q", "K"));
System.out.println (Movecard (a));
}
}

* Program output: Analyze the code logic and infer the code at the dash.

* End of comment on the program head

*/

On the code:

if (Dst.size () ==13) break; Blanks


Dst.add (src.remove (0)); Blanks

The third session of Blue Bridge Cup Javac Group _ poker Move

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.