码迷,mamicode.com
首页 > 其他好文 > 详细

请输入验证码

时间:2015-10-12 22:36:53      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:

 

 1            String str11 = "abcdefghijklmnopqrstuvwxyz";
 2            String str12 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 3            String str13 = "12345678901234567890123456";
 4            System.out.println("请输入验证码:");
 5            for(int x = 1; x <= 4; x++)
 6            {
 7                Random a = new Random();
 8                Random b = new Random();
 9                Random c = new Random();
10                Random d = new Random();
11                int m = a.nextInt(26);
12                int f = c.nextInt(26);
13                int e = d.nextInt(26);
14                int n = b.nextInt(3);
15                if(n == 0)
16                {
17                    System.out.print(str11.charAt(e) + " ");
18                }
19                else if(n == 1)
20                {
21                    System.out.print(str12.charAt(f) + " ");
22                }
23                else if(n == 2)
24                {
25                    System.out.print(str13.charAt(m) + " ");
26                }
27            }

技术分享

请输入验证码

标签:

原文地址:http://www.cnblogs.com/wgbs25673578/p/4872986.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!