程序人生  
我们站在同一起跑线上,让我们共同努力,共同奋进,愿您的人生因程序而美好!
日历
<2025年7月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
统计
  • 随笔 - 0
  • 文章 - 38
  • 评论 - 8
  • 引用 - 0

导航

留言簿(2)

文章分类

文章档案

常用Web 站点

搜索

  •  

最新评论

 

package com.eruite.test;

import java.util.Random;

public class Poker {
 public static void main(String[] args) {
  int[] pokers = new int[54];
  for (int i = 0; i < pokers.length; i++)
   pokers[i] = i;
  int j = 0, temp = 0;
  for (int i = 0; i < pokers.length; i++) {
   Random r = new Random();
   j = r.nextInt(54);
   temp = pokers[i];
   pokers[i] = pokers[j];
   pokers[j] = temp;
  }
  for (int i = 0; i < pokers.length; i++) {
   System.out.print(pokers[i] + " ");
   if ((i + 1) % 10 == 0)
    System.out.println();
  }
 }
}

posted on 2008-03-28 18:01 蔡华林 阅读(172) 评论(0)  编辑  收藏 所属分类: j2se
 
Copyright © 蔡华林 Powered by: 博客园 模板提供:沪江博客