登录
首页 » 其他 » Visual C# 韩信点兵算法演示源码

Visual C# 韩信点兵算法演示源码

于 2022-01-25 发布 文件大小:12.77 kB
0 228
下载积分: 2 下载次数: 1

代码说明:

韩信点兵是一道古代数学题,内容是:韩信带兵不足百人,三人一行排列多一个,七人一行排列少两个,五人一行排列正好。相关代码:   int a = 0, b = 0, c = 0;//定义变量   for (int i = 1; i < 100; i++)//遍历    {    Math.DivRem(i, 3, out a);//3行一列时取余    Math.DivRem(i, 5, out b);//5行一列时取余    Math.DivRem(i, 7, out c);//7行一列时取余    if (a == 1 && b == 0 && c == 5)//如果3种方式的余数符合要求    {    textBox1.Text = i.ToString();//显示人数    return;    }

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 贪婪算法解决背包问题
    贪婪算法解决背包问题-greedy algorithm to solve knapsack problem
    2022-01-26 04:23:16下载
    积分:1
  • VC++在应用程序中使用标准窗口控件初步
    VC++在应用程序中使用标准窗口控件初步-VC in applications using standard window controls preliminary
    2022-02-28 22:56:19下载
    积分:1
  • AutoCAD的dwg
    AutoCAD DWG-file viewer
    2022-08-04 10:30:40下载
    积分:1
  • calculated cone
    计算球顶圆锥的RCS程序,输入频率和角度,球锥的外形尺寸等,得到其RCS。这个程序是俺老师给的,只供参考-calculated cone-top RCS procedures input frequency and angle of the cone-shape size, to be its RCS. The program is the teacher I have for the use of reference
    2022-02-01 00:02:51下载
    积分:1
  • use J2ME prepared by the Air Combat small cell phone games, more classic and sha...
    用J2ME编写的手机飞机空战小游戏,比较经典,与大家共享-use J2ME prepared by the Air Combat small cell phone games, more classic and share
    2022-01-25 23:17:23下载
    积分:1
  • 这是一个学习包,里面都是关于算法的学习包,中的很多文章是我很艰难遭到的,与大家一起分享。...
    这是一个学习包,里面都是关于算法的学习包,其中的很多文章是我很艰难遭到的,与大家一起分享。-This is a learning kits, which are on the learning algorithm packs, Many articles in which I was very difficult, and share with everyone.
    2022-03-15 20:21:28下载
    积分:1
  • 计算机机房管理系统
    计算机机房管理系统-Computer Room Management System
    2023-04-14 15:40:03下载
    积分:1
  • VC++6.0 在程序内注册ActiveX控件的例子源码
    VC++6.0 在程序内注册ActiveX控件的例子源码,在程序中动态注册控件到Windows系统中,注册后所依赖该控件的程序才可正常运行。核心代码如下:   //加载ActiveX控件   HINSTANCE hLib = LoadLibrary(lpszDllName);   if (hLib == NULL)   {    TRACE(_T("%s加载失败 "), lpszDllName);    return FALSE;   }   //获得注册函数DllRegisterServer地址   FARPROC lpDllEntryPoint;   lpDllEntryPoint = GetProcAddress(hLib, _T("DllRegisterServer"));   //调用注册函数DllRegisterServer   if (lpDllEntryPoint != NULL)   {    if (FAILED((*lpDllEntryPoint)()))    {    TRACE(_T("调用DllRegisterServer失败 "));    FreeLibrary(hLib);    return FALSE;    }    else    {    FreeLibrary(hLib);    return TRUE;    }   }   else   {    TRACE(_T("调用DllRegisterServer失败 "));    FreeLibrary(hLib);    return FALSE;   }   更多代码请下载本源码包。
    2022-08-18 20:45:44下载
    积分:1
  • Windows API programming documents, the following Windows programming knowledge r...
    Windows API编程文档,Windows下面编程必备常识。^_^-Windows API programming documents, the following Windows programming knowledge required. ^ _ ^
    2022-08-03 01:17:00下载
    积分:1
  • StaMps最新测试版,用于PS
    StaMps最新测试版,用于PS-InSAR处理-StaMps the latest test version of treatment for PS-InSAR
    2022-03-10 23:56:20下载
    积分:1
  • 696518资源总数
  • 106245会员总数
  • 18今日下载