using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace 第六天_流程语句
{
class Program
{
static void Main(string[] args)
{
Random r = new Random(); //1.创建一个能产生随机数的对象
while (true)
{
int _numR = r.Next(, ); //2.让产生随机数的这个对象 调用方法来产生随机数 能取到1到不能取到10,左闭右开区间。
Console.WriteLine(_numR);
Console.ReadKey();
}
}
}
}
 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace 第六天_流程语句
{
class Program
{
static void Main(string[] args)
{
Random r = new Random(); //1.创建一个能产生随机数的对象
while (true)
{
int _numR = r.Next(, ); //2.让产生随机数的这个对象 调用方法来产生随机数 能取到1到不能取到7,左闭右开区间。6种可能
Console.WriteLine("请输入您的名字:");
string _name = Console.ReadLine(); //伪代码,对下面操作无影响
switch (_numR)
{
case :
Console.WriteLine("你上辈子是个大臣");
break;
case :
Console.WriteLine("你上辈子是个诸侯");
break;
case :
Console.WriteLine("你上辈子是个农民");
break;
case :
Console.WriteLine("你上辈子是个王子");
break;
case :
Console.WriteLine("你上辈子是个公主");
break;
default:
Console.WriteLine("你上辈子是个侍女");
break; }
Console.ReadKey();
}
}
}
}

最新文章

  1. 从零构建JavaScript的对象系统
  2. linux线程同步(5)-屏障
  3. python 字符串 转 dict
  4. ural 1215 Exactness of Projectile Hit
  5. sql server varchar(10)和 nvarchar(10)存储数据长度
  6. 用VBA宏从一个工作薄复制内容到另一个工作薄
  7. windows下oracle数据库定时备份与压缩批处理脚本(win7/win2008亲测通过)
  8. 【记录】Spring项目转化为Spring Web项目
  9. css之幽灵空白节点
  10. 说一说MVC的CompressActionFilterAttrubute(五)
  11. Windows服务器环境下jenkins下载和安装
  12. .NET简单学习
  13. BZOJ3172 [Tjoi2013]单词 字符串 SA ST表
  14. 读取excel日期数据问题
  15. [JXOI2018]游戏 (线性筛,数论)
  16. kafka后台启动的命令
  17. [Android] Service服务详解以及如何使service服务不被杀死
  18. centos7: svbversion版本的安装配置+tortoisesvn登录验证
  19. HBase——使用Put迁移MySql数据到Hbase
  20. python三大神器之迭代器

热门文章

  1. C# ModBus 读取数据
  2. Nacos(六):多环境下如何“管理”及“隔离”配置和服务
  3. shell习题1
  4. Linux命令行中好用的快捷键
  5. 为了完成这个功能,我竟然用5行代码制作了一个EXE可执行程序
  6. Selenium3 + Python3自动化测试系列九——cookie操作
  7. Codeforces 936B
  8. BigDecimal 使用浅析
  9. Leetcode之深度优先搜索(DFS)专题-473. 火柴拼正方形(Matchsticks to Square)
  10. C#开发BIMFACE系列17 服务端API之获取模型数据2:获取构件材质列表