-
Category : JSP/Java
Tags :
- Update : 2008-10-13
- Size : 1.49kb
- Downloaded :0次
- Author :y***
- About :
yy
- PS : If download it fails, try it again. Download again for free!
Introduction - If you have any usage issues, please Google them yourself
Java: find shunzi in n CARDS
So here's the problem: there are n CARDS, and the value of each card is: 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A. Find the shunzi (5 CARDS and 5 consecutive CARDS) in these n CARDS and print them out.
Thought: my idea is very simple, first is to remove the duplicate card, because the same as the same as the number one, it is obvious that the Set in JAVA is suitable for this job. You also need to sort these CARDS, and there's no doubt that TreeSet. Then go through the CARDS from the small to large, and set up a counter count. If any consecutive CARDS are found, count+ +; If found discontinuous, in 2: if count> 4, find a shunzi and save it; Instead, do nothing. And then count is equal to 1, and I'm going to start looking for a new one. Here's the code:
Packet file list
(Preview for download)
Packet : 25811217zhaopai.rar filelist
在n 张扑克牌中找出顺子.java
Related instructions
- We are an exchange download platform that only provides communication channels. The downloaded content comes from the internet. Except for download issues, please Google on your own.
- The downloaded content is provided for members to upload. If it unintentionally infringes on your copyright, please contact us.
- Please use Winrar for decompression tools
- If download fail, Try it againg or Feedback to us.
- If downloaded content did not match the introduction, Feedback to us,Confirm and will be refund.
- Before downloading, you can inquire through the uploaded person information