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

资源简介

数学模拟钉板实验c#源码

资源截图

代码片段和文件信息

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

namespace ConsoleApplication14
{
    class Class1
    {


        int t0 = 0;
        int t2 = 0;
        int t4 = 0;
        int t6 = 0;
        int t8 = 0;
        int t10 = 0;
        int t12 = 0;
        int t14 = 0;
        int t16 = 0;
        int t18 = 0;
        int t20 = 0;
        int t22 = 0;
        int t24 = 0;
        int t26 = 0;
        int t28 = 0;
        int t30 = 0;
        int t32 = 0;
        Random b = new Random(); 
        private int c;

        private int d ;

        private int f;

        public Class1(int a) 
        {
            f = a;
        }
        public void m() 
        {
            c = 16;
            for (int x = 0; x < 16; x++) 
            {
                d = b.Next(2);
                if (d == 1)
                    c += 1;
                else
                    c -= 1;
            }

        }




        private void i(int c) 
        {
            switch (c) 
            {
                case 0:
                    ++t0;
                    break;
                case 2:
                    ++t2;
                    break;

                case 4:
                    ++t4;
                    break;
                case 6:
                    ++t6;
                    break;
                case 8:
                    ++t8;
                    break;
                case 10:
                    ++t10;
                    break;
                case 12:
                    ++t12;
                    break;

                case 14:
                    ++t14;
                    break;

                case 16:
                    ++t16;
                    break;
                case 18:
                    ++t18;
                    break;
                case 20:
                    ++t20;
                    break;
                case 22:
                    ++t22;
                    break;
                case 24:
                    ++t24;
                    break;
                case 26:
                    ++t26;
                    break;
                case 28:
                    ++t28;
                    break;
                case 30:
                    ++t20;
                    break;
                case 32:
                    ++t32;
                    break;

            }
        }


        public void n() 
        {
            for (int v = f; v >= 0; v--) 
            {
                m();
                i(c);

            }
        }

        public string  ToSting() 
        {
            return string.Format(“1:{0}\n2:{1}\n3:{2}\n4:{3}\n5:{4}\n6:{5}\n7:{6}\n8:{7}\n9:{8}\n10:{9}\n11:{10}\n12:{11}\n13:{12}\n14:{13}\n15:{14}\n16:{15}\n17:{16}\n“ t0 t2 t4 t6 t8 t10 t12 t14 t16 t18 t20 t22 t24 t26 t28 t30 t32);
        }

    }
}

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

     文件       6656  2011-03-29 00:05  钉板实验\ConsoleApplication14\bin\Debug\ConsoleApplication14.exe

     文件      15872  2011-03-29 00:05  钉板实验\ConsoleApplication14\bin\Debug\ConsoleApplication14.pdb

     文件      14328  2011-03-29 00:06  钉板实验\ConsoleApplication14\bin\Debug\ConsoleApplication14.vshost.exe

     文件        490  2009-06-11 05:14  钉板实验\ConsoleApplication14\bin\Debug\ConsoleApplication14.vshost.exe.manifest

     文件       3005  2011-03-29 00:04  钉板实验\ConsoleApplication14\Class1.cs

     文件       2550  2011-03-28 23:59  钉板实验\ConsoleApplication14\ConsoleApplication14.csproj

     文件        516  2011-03-29 00:06  钉板实验\ConsoleApplication14\obj\Debug\ConsoleApplication14.csproj.FileListAbsolute.txt

     文件       6656  2011-03-29 00:05  钉板实验\ConsoleApplication14\obj\Debug\ConsoleApplication14.exe

     文件      15872  2011-03-29 00:05  钉板实验\ConsoleApplication14\obj\Debug\ConsoleApplication14.pdb

     文件        406  2011-03-29 00:08  钉板实验\ConsoleApplication14\Program.cs

     文件       1372  2011-03-28 22:34  钉板实验\ConsoleApplication14\Properties\AssemblyInfo.cs

     文件        950  2011-03-28 22:34  钉板实验\ConsoleApplication14.sln

    ..A..H.     12288  2011-03-29 00:08  钉板实验\ConsoleApplication14.suo

     目录          0  2011-03-28 22:34  钉板实验\ConsoleApplication14\obj\Debug\TempPE

     目录          0  2011-03-29 00:01  钉板实验\ConsoleApplication14\bin\Debug

     目录          0  2011-03-29 00:05  钉板实验\ConsoleApplication14\obj\Debug

     目录          0  2011-03-28 22:34  钉板实验\ConsoleApplication14\bin

     目录          0  2011-03-28 22:34  钉板实验\ConsoleApplication14\obj

     目录          0  2011-03-28 22:34  钉板实验\ConsoleApplication14\Properties

     目录          0  2011-03-29 00:08  钉板实验\ConsoleApplication14

     目录          0  2011-03-28 22:34  钉板实验

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

                80961                    21


评论

共有 条评论

相关资源