集合ArrayList双色球练一练(自己的方法,太麻烦)
namespace 集合__双色球练一练
{
class Program
{
static void Main(string[] args)
{
// while (true)
// {
// ArrayList al = new ArrayList();
// al.Add(1); al.Add(2); al.Add(3); al.Add(4); al.Add(5); al.Add(6); al.Add(7); al.Add(8); al.Add(9); al.Add(10); al.Add(11); al.Add(12); al.Add(13); al.Add(14); al.Add(15); al.Add(16); al.Add(17); al.Add(18); al.Add(19); al.Add(20); al.Add(21); al.Add(22); al.Add(23); al.Add(24); al.Add(25); al.Add(26); al.Add(27); al.Add(28); al.Add(29); al.Add(30); al.Add(31); al.Add(31); al.Add(31);
// Random r = new Random();
// int x = r.Next(1,al.Count);
// Console.Write(x+"\t");
// al.Remove(x);
// int y = r.Next(1, al.Count);
// Console.Write(y + "\t");
// al.Remove(y);
// int z = r.Next(1, al.Count);
// Console.Write(z + "\t");
// al.Remove(z);
// int s = r.Next(1, al.Count);
// Console.Write(s + "\t");
// al.Remove(s);
// int t = r.Next(1, al.Count);
// Console.Write(t + "\t");
// al.Remove(t);
// int w = r.Next(1, al.Count);
// Console.Write(w + "\t");
// al.Remove(w);
// //蓝球
// int q = r.Next(1, 17);
// Console.Write("蓝球为"+q + "\t");
// Console.ReadLine();
// }
//Random r = new Random();
//ArrayList al = new ArrayList();
//while (true)
//{
// if (al.Count == 6)
// {
// break;
// }
// else
// {
// int a = r.Next(1, 34);
// if (al.Contains(a))
// {
// }
// else
// {
// al.Add(a);
// }
// }
//}
//al.Sort();
//Console.Write("红球为\t");
//for (int i = 0; i < al.Count; i++)
//{
// Console.Write(al[i] + "\t");
//}
//int y = r.Next(1, 17);
//Console.Write("蓝球为" + y);
//Console.ReadLine();
}
}
}
集合ArrayList双色球练一练(自己的方法,太麻烦)的更多相关文章
- 集合ArrayList习题练一练——分数
namespace 集合习题练一练{ class Program { static void Main(string[] args) { ...
- Java ArrayList和Vector、LinkedList与ArrayList、数组(Array)和列表集合(ArrayList)的区别
ArrayList和Vector的区别ArrayList与Vector主要从二方面来说. 一.同步性: Vector是线程安全的,也就是说是同步的,而ArrayList是线程序不安全的,不是同步 ...
- 集合ArrayList
/*集合ArrayList * 例如: * 1.创建:ArrayList<Egg> myList = new ArrayList<Egg>(); * Egg类型的集合 ...
- 面向对象之集合ArrayList
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using S ...
- 集合及特殊集合arrayList
1,运用集合 arrayList 首先复制Colections加 : 创建arrayList ar =new arrayList(); ArrayList具体提供的功能:属性 ...
- Java 集合 ArrayList和LinkedList的几种循环遍历方式及性能对比分析 [ 转载 ]
Java 集合 ArrayList和LinkedList的几种循环遍历方式及性能对比分析 @author Trinea 原文链接:http://www.trinea.cn/android/arrayl ...
- 从源码看集合ArrayList
可能大家都知道,java中的ArrayList类,是一个泛型集合类,可以存储指定类型的数据集合,也知道可以使用get(index)方法通过索引来获取数据,或者使用for each 遍历输出集合中的内容 ...
- ava集合---ArrayList的实现原理
一.ArrayList概述 ArrayList是基于数组实现的,是一个动态数组,其容量能自动增长,类似于C语言中的动态申请内存,动态增长内存 ArrayList不是线程安全的,只能用在单线程环境下,多 ...
- Java集合-ArrayList源码解析-JDK1.8
◆ ArrayList简介 ◆ ArrayList 是一个数组队列,相当于 动态数组.与Java中的数组相比,它的容量能动态增长.它继承于AbstractList,实现了List, RandomAcc ...
随机推荐
- ios应用来电监听
先导入这两个头文件,库文件不用导可以 #import <CoreTelephony/CTCallCenter.h> #import <CoreTelephony/CTCall.h&g ...
- UITextField文本字段控件的位置
如果需要更改默认的UITextField清除按钮.左右视图等等控件的位置,可以通过如下设置: // 控制清除按钮的位置 (默认 width = 15 = height) -(CGRect)clearB ...
- use mkisofs 重新打包beini,tinycore linux
mkisofs -r -J -V Beini-Custom -v --boot-info-table --boot-load-size 4 -b boot/isolinux/isolinux.bin ...
- Js编码和Java后台解码
1.java.将resultMsg 转为utf-8 (1) resultMsg = URLEncoder.encode(resultMsg, "utf-8"); (2) new S ...
- 《ext江湖》第8章继承-代码片段
创建Animal对象 <html> <head> <title>11</title> <META HTTP-EQUIV="Content ...
- ubuntu netbeans compile ygopro client with google protobuf lib
environment: ubuntu 16.04 netbeans 8.2 ygopro Fluorohydride with Irrlicht Game Engine 问题1: google pr ...
- IF EXIST: The syntax of the command is incorrect.
Batch 脚本中使用 IF EXIST 语句时,总是提示 The syntax of the command is incorrect. 原始 bat 脚本如下: ECHO OFF SET proj ...
- c++primer复习(一)
1 const对象默认为文件的局部变量(P50) a.cpp ; b.cpp extern int a;//undefined reference to "a" a.cpp ; b ...
- WPF页面跳转
WPF页面跳转有两种:一种是windows,另外一种是page 1:windows页面跳转windows 页面跳转相信学过winform编程的哥们都知道,先实例化该窗体然后show一下就可以了.eg ...
- 每天一条linux命令——crontab
crontab命令被用来提交和管理用户的需要周期性执行的任务,与windows下的计划任务类似,当安装完成操作系统后,默认会安装此服务工具,并且会自动启动crond进程,crond进程每分钟会定期检查 ...