查看: 0|回复: 0

java

[复制链接]

主题

帖子

5

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
5
发表于 昨天 02:04 | 显示全部楼层 |阅读模式
  import java.util.Random;
  public class Co
  {
  public static void main(String[] args)
  {  
  Random a=new Random();
  char[] b=new char[4];
  for (int i=0;i<b.length ;i++ )
  {
  int a1=a.nextInt(26);
  char b1=(char)(65+a1);
  for (int j=0;j<b.length ;j++ )
  {  
  char b2=b[j];
  }
  if (b1==b2)
  {
  System.out.println("什么都别做");
  }
  else
  {
  b=b1;
  }
  }for (int i=0;i<b.length ;b1++ )
  {
  System.out.print(b);
  }
  }
  }
   
   
   
   
   
   
   http://m.lifang521.com/tag/69590/
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|文学之旅交流

GMT+8, 2024-10-17 12:26 , Processed in 0.032531 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表