A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 乐丶小洛 中级黑马   /  2016-7-24 14:55  /  1163 人查看  /  7 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

String[] names = {"苍井空","波多野结衣","野宫里美","橘梨纱","松岛枫","大沢佑香","朱音唯","香山圣","麻仓优","吉沢明歩","樱理惠","冬月楓","竹內愛","七海奈奈","七海奈奈",
                      "秋元美由","遥惠美","佐藤遥希","大月麻友花","美優千奈","結川るり","麻生希","京香じゅりあ","立花静","西野翔","白石茉莉奈","上原亚衣","赤井美月","爱田友","宇都宫紫苑",
                      "初音实","山咲舞","坂口美穗乃","泷泽萝拉","小川あさ美","雪本芽衣","大橋未久","星野美优","野村萌香","神波多一花","香澄乃亞","上原瑞穗","加藤莉娜","北条麻妃","花井美沙",
                      "蒂亚ティア","原千草","真白美那","咲夜由愛","早川濑里奈","月野里沙","桃谷绘里香","白咲舞","永沢まおみ","天衣美津","小向まな美","管野靜香","冴岛香织","歩原ひかる",
                      "逢田美波","小泽玛利亚","吉川爱美","板野有紀","松本芽依","杏树纱奈","宇佐美なな","前田香织","水无濑优夏"," つぼみ 蕾","成濑心美","愛沢有紗","瑠川莉娜","村上里沙",
                      "石川施恩惠","瑞樹ララ","茜あずさ","愛実れい","夏目奈奈","清见玲","藤本もも","双葉みか","希崎杰西卡","纱仓真奈","羽田爱","菅野さゆき","藤浦惠","池田美和子","安達亜美",
                      "笹原莉梦","上原结衣","櫻井莉亞","雪見紗弥","雾岛奈津美","前田陽菜","橘綺羅","小島南","爱乃娜美","初美理音","藤原瞳","樱井步"};

               
                while(true){
       
                        double random = Math.random();
                        random*=names.length;

                        int index = (int)random;
                        System.out.println(names[index]+"送你了,要继续吗?");

                        System.out.println("按任意键继续,0结束本次翻牌");
                        java.util.Scanner sc = new java.util.Scanner(System.in);
                        int input = sc.nextInt();
                        if(input == 0){
                                break;
                        }
                }
纯属娱乐,看着玩吧,从群里看到的  嘿嘿

7 个回复

倒序浏览
哈哈哈...我来刷分
回复 使用道具 举报
不给种的都死了
回复 使用道具 举报
深得冯佳老师真传~~~!
回复 使用道具 举报
老司机老司机
回复 使用道具 举报
老司机哈哈
回复 使用道具 举报
污`````呜呜呜呜     静静的路过!!

老司机呀老司机

为啥不用集合存放这些 名字字符串.  感觉用集合比较方便.....!!!

回复 使用道具 举报
冯佳老师有点低俗,,,不过善于调动气氛...不多说了,就这样
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马