91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 110KB
    文件類型: .zip
    金幣: 2
    下載: 1 次
    發布日期: 2022-08-27
  • 語言: C#
  • 標簽: C#??

資源簡介

找零錢算法 C#實現

資源截圖

代碼片段和文件信息

using?Common;
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?WindowsFormsApplication1
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}

????????private?void?btn_Click(?object?sender??EventArgs?e?)
????????{
????????????//?獲取輸入

????????????int?total?=?Convert.ToInt32(?tbTotal.Text?);

????????????var?strs?=?tbElements.Text.Split(?new?string[?]?{?““?}??StringSplitOptions.None?);
????????????List?elems?=?new?List();
????????????foreach(?var?str?in?strs?)
????????????{
????????????????var?n?=?Convert.ToInt32(?str?);
????????????????elems.Add(?n?);
????????????}

????????????var?num?=?Convert.ToInt32(?tbNumOfSolutions.Text?);

????????????var?stopwatch?=?new?System.Diagnostics.Stopwatch();
????????????stopwatch.Start();?//??開始監視代碼運行時間

????????????tbRet.Text?=?“正在求解...?...“;

???????????//?計算
???????????var?ret?=?MumberDecompose.Decompose(?total??elems??num?);

????????????stopwatch.Stop();?//??停止監視
????????????TimeSpan?timespan?=?stopwatch.Elapsed;?//??獲取當前實例測量得出的總時間
????????????var?Elapsed?=?timespan.TotalMilliseconds;

????????????ShowRet(?ret??Elapsed?);

????????}

????????void?ShowRet(?List>?ret???double?Elapsed?)
????????{
????????????string?str?=?““;

????????????str?+=?“耗時:“?+?Elapsed.ToString()?+?“?毫秒“?+?“\r\n?\r\n“?;
????????????str?+=?“解個數:“?+?ret.Count.ToString()?+?“\r\n?\r\n“;

????????????var?sb?=?new?StringBuilder();
????????????foreach?(?var?s?in?ret?)
????????????{
????????????????var?sb2?=?new?StringBuilder();
????????????????foreach?(?var?e?in?s?)
????????????????{
????????????????????sb2.Append(?e?);
????????????????????sb2.Append(?“?+?“?);
????????????????}
????????????????sb2.Remove(?sb2.Length?-?3??3?);
????????????????sb2.Append(?“\r\n“?)??;

????????????????sb.Append(?sb2.ToString()?);

????????????}

????????????str?+=?sb.ToString();

????????????tbRet.Text?=?str;

????????}

????}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-06-22?11:27??WindowsFormsApplication1\
?????目錄???????????0??2017-06-22?11:27??WindowsFormsApplication1\.vs\
?????目錄???????????0??2017-06-22?11:27??WindowsFormsApplication1\.vs\WindowsFormsApplication1\
?????目錄???????????0??2017-06-22?11:27??WindowsFormsApplication1\.vs\WindowsFormsApplication1\v14\
?????文件???????53248??2017-06-22?14:02??WindowsFormsApplication1\.vs\WindowsFormsApplication1\v14\.suo
?????目錄???????????0??2017-06-22?13:53??WindowsFormsApplication1\WindowsFormsApplication1\
?????文件????????1039??2017-06-22?11:27??WindowsFormsApplication1\WindowsFormsApplication1.sln
?????文件?????????189??2017-06-22?11:27??WindowsFormsApplication1\WindowsFormsApplication1\App.config
?????目錄???????????0??2017-06-22?12:51??WindowsFormsApplication1\WindowsFormsApplication1\bin\
?????目錄???????????0??2017-06-22?11:55??WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\
?????文件???????12288??2017-06-22?12:51??WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
?????文件?????????189??2017-06-22?11:27??WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe.config
?????文件???????24064??2017-06-22?12:51??WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
?????文件???????22696??2017-06-22?12:51??WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe
?????文件?????????189??2017-06-22?11:27??WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.config
?????文件?????????490??2017-03-19?05:00??WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest
?????目錄???????????0??2017-06-23?01:30??WindowsFormsApplication1\WindowsFormsApplication1\bin\Release\
?????文件???????11776??2017-06-23?00:00??WindowsFormsApplication1\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.exe
?????文件?????????189??2017-06-22?11:27??WindowsFormsApplication1\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.exe.config
?????文件???????24064??2017-06-23?00:00??WindowsFormsApplication1\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.pdb
?????文件???????22696??2017-06-23?01:29??WindowsFormsApplication1\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.vshost.exe
?????文件?????????189??2017-06-22?11:27??WindowsFormsApplication1\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.vshost.exe.config
?????文件?????????490??2017-03-19?05:00??WindowsFormsApplication1\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.vshost.exe.manifest
?????文件????????5439??2017-06-23?01:30??WindowsFormsApplication1\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.zip
?????文件????????2299??2017-06-22?13:53??WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs
?????文件????????6834??2017-06-22?13:23??WindowsFormsApplication1\WindowsFormsApplication1\Form1.Designer.cs
?????文件????????5817??2017-06-22?13:23??WindowsFormsApplication1\WindowsFormsApplication1\Form1.resx
?????文件????????2167??2017-06-22?13:52??WindowsFormsApplication1\WindowsFormsApplication1\MumberDecompose.cs
?????目錄???????????0??2017-06-22?12:51??WindowsFormsApplication1\WindowsFormsApplication1\obj\
?????目錄???????????0??2017-06-22?12:51??WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\
?????文件?????????868??2017-06-22?11:27??WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferences.cache
............此處省略33個文件信息

評論

共有 條評論