資源簡介
可設定范圍內隨機數產生的概率,精準率相差5%左右
vs2017編寫
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;
namespace?概率隨機數
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????string?str?=?““;
????????????int?lmax?=?0;
????????????int?lmin?=?0;
????????????for?(int?i?=?0;?i?100;?i++)
????????????{
????????????????double?dret?=?getRndP(1?100?1?30?70);
????????????????
????????????????if?(dret?>?30)
????????????????????lmax++;
????????????????else
????????????????????lmin++;
????????????????str?+=?dret.ToString()+“??“;
????????????????if?((i+1)?%?5?==?0)
????????????????????str?+=?“\r\n“;
????????????}
????????????richTextBox1.Text?=“小于等于30數:“+lmin+“?大于30數:“+lmax+“\r\n“+?str;
????????}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????189??2018-10-06?15:44??概率隨機數\App.config
?????文件??????11776??2018-10-11?18:54??概率隨機數\bin\Debug\概率隨機數.exe
?????文件????????189??2018-10-06?15:44??概率隨機數\bin\Debug\概率隨機數.exe.config
?????文件??????36352??2018-10-11?18:54??概率隨機數\bin\Debug\概率隨機數.pdb
?????文件???????5190??2018-10-06?18:51??概率隨機數\Form1.cs
?????文件???????4319??2018-10-06?18:51??概率隨機數\Form1.Designer.cs
?????文件???????5817??2018-10-06?18:51??概率隨機數\Form1.resx
?????文件????????831??2018-10-06?15:44??概率隨機數\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????7148??2018-10-06?16:39??概率隨機數\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件??????????0??2018-10-06?15:44??概率隨機數\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件??????????0??2018-10-06?15:44??概率隨機數\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件??????????0??2018-10-06?15:44??概率隨機數\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
?????文件?????????42??2018-10-06?16:39??概率隨機數\obj\Debug\概率隨機數.csproj.CoreCompileInputs.cache
?????文件????????815??2018-10-06?15:47??概率隨機數\obj\Debug\概率隨機數.csproj.FileListAbsolute.txt
?????文件???????1012??2018-10-06?18:51??概率隨機數\obj\Debug\概率隨機數.csproj.GenerateResource.cache
?????文件??????11490??2018-10-06?15:44??概率隨機數\obj\Debug\概率隨機數.csprojAssemblyReference.cache
?????文件??????11776??2018-10-11?18:54??概率隨機數\obj\Debug\概率隨機數.exe
?????文件????????180??2018-10-06?18:51??概率隨機數\obj\Debug\概率隨機數.Form1.resources
?????文件??????36352??2018-10-11?18:54??概率隨機數\obj\Debug\概率隨機數.pdb
?????文件????????180??2018-10-06?17:02??概率隨機數\obj\Debug\概率隨機數.Properties.Resources.resources
?????文件????????527??2018-10-06?15:44??概率隨機數\Program.cs
?????文件???????1328??2018-10-06?15:44??概率隨機數\Properties\AssemblyInfo.cs
?????文件???????2843??2018-10-06?15:44??概率隨機數\Properties\Resources.Designer.cs
?????文件???????5612??2018-10-06?15:44??概率隨機數\Properties\Resources.resx
?????文件???????1102??2018-10-06?15:44??概率隨機數\Properties\Settings.Designer.cs
?????文件????????249??2018-10-06?15:44??概率隨機數\Properties\Settings.settings
?????文件????????351??2018-10-06?16:41??概率隨機數\RndDSection.cs
?????文件???????3660??2018-10-06?17:02??概率隨機數\概率隨機數.csproj
?????目錄??????????0??2018-10-06?15:44??概率隨機數\obj\Debug\TempPE
?????目錄??????????0??2018-10-06?15:47??概率隨機數\bin\Debug
............此處省略9個文件信息
- 上一篇:CSharp PcapWakeOnLan
- 下一篇:實現3個窗體跳轉和全部關閉
評論
共有 條評論