• 大小: 0.02M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-02-24
  • 语言: C#
  • 标签:

资源简介


资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {


        static int WinPlayer;
        static int WinComputer;
        public static void PrintCnt()
        {
            Console.WriteLine(“玩家赢了“ + WinPlayer.ToString() + “次“);
            Console.WriteLine(“电脑赢了“ + WinComputer.ToString() + “次“);    
        }

        //1.解决输入有效性

        //2.控制玩家的赢面 - 当玩家次数高于20次且 赢的比率 达到了 50%,就用调用函数
        //玩家赢的比率降到 30%

        //3.调用一个方法永远是电脑赢

        //1. 石头  2.剪刀  3.布
        static void Main(string[] args)
        {
            int player = 0;
            int computer = 0;

            while (true)
            {

                computer = (new Random()).Next(1 4);

                Console.WriteLine(“请出拳 1 - 石头  2 - 剪刀  3 - 布“);
                player = int.Parse(Console.ReadLine());

                if (player == computer)
                {
               

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1026  2017-12-12 10:34  ConsoleApplication1\ConsoleApplication1.sln

    ..A..H.     19456  2017-12-12 10:58  ConsoleApplication1\ConsoleApplication1.v12.suo

     文件       2514  2017-12-12 10:34  ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.csproj

     文件       1798  2017-12-12 10:58  ConsoleApplication1\ConsoleApplication1\Program.cs

     文件       5632  2017-12-12 10:53  ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe

     文件      13824  2017-12-12 10:53  ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.pdb

     文件      11592  2017-12-18 18:57  ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.vshost.exe

     文件        490  2010-03-17 22:39  ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.vshost.exe.manifest

     文件        788  2017-12-18 18:57  ConsoleApplication1\ConsoleApplication1\obj\Debug\ConsoleApplication1.csproj.FileListAbsolute.txt

     文件       5632  2017-12-12 10:53  ConsoleApplication1\ConsoleApplication1\obj\Debug\ConsoleApplication1.exe

     文件      13824  2017-12-12 10:53  ConsoleApplication1\ConsoleApplication1\obj\Debug\ConsoleApplication1.pdb

     文件       5704  2017-12-18 18:07  ConsoleApplication1\ConsoleApplication1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       1362  2017-12-12 10:34  ConsoleApplication1\ConsoleApplication1\Properties\AssemblyInfo.cs

     文件        927  2017-12-14 10:41  ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.sln

    ..A..H.     15360  2017-12-18 18:57  ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.suo

     目录          0  2017-12-12 10:59  ConsoleApplication1\ConsoleApplication1\obj\Debug\TempPE

     目录          0  2017-12-12 10:59  ConsoleApplication1\ConsoleApplication1\bin\Debug

     目录          0  2017-12-12 10:59  ConsoleApplication1\ConsoleApplication1\obj\Debug

     目录          0  2017-12-12 10:59  ConsoleApplication1\ConsoleApplication1\bin

     目录          0  2017-12-12 10:59  ConsoleApplication1\ConsoleApplication1\obj

     目录          0  2017-12-12 10:59  ConsoleApplication1\ConsoleApplication1\Properties

     目录          0  2017-12-12 10:59  ConsoleApplication1\ConsoleApplication1

     目录          0  2017-12-12 10:59  ConsoleApplication1

----------- ---------  ---------- -----  ----

                99929                    23


评论

共有 条评论