![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法研究
wushuai1346
这个作者很懒,什么都没留下…
展开
-
数独算法
废话少说,直接贴代码://--------------------------------////作者:不喝橙汁//完成日期:09.12.30//--------------------------------//public class Suduku_Core{ private int[] hole=new int[81]; private int[][] test=new原创 2009-12-30 20:40:00 · 3213 阅读 · 1 评论 -
指针和函数
编写一个函数,该函数具有两个形参,分别为int型和指向Int型的指针,并返回这两个int值之中较大的数值.考虑应将其指针形参定义为什么类型?#include using namespace std;int max(const int &x,const int* &y){ return x>= *y ?x: *y;}void main( ){ int v1=90;原创 2009-07-11 20:07:00 · 531 阅读 · 0 评论 -
素数算法3种
①----------------------------------------------------------------------------------------------------------------------------------------------------马宁德拉·阿格拉瓦(附:素数判定算法(当且仅当n为素数时,最终输出数才为素数))原创 2009-07-06 19:55:00 · 1386 阅读 · 1 评论 -
最大公约数算法
1、欧几里德算法和扩展欧几里德算法 欧几里德算法 欧几里德算法又称辗转相除法,用于计算两个整数a,b的最大公约数。其计算原理依赖于下面的定理: 定理:gcd(a,b) = gcd(b,a mod b) 证明:a可以表示成a = kb + r,则r = a mod b 假设d是a,b的一个公约数,则有 d|a, d|b,而r = a - kb,因此d|r 因此原创 2009-07-06 20:17:00 · 531 阅读 · 0 评论 -
速算24点
看了这个帖子学习的,方法和原理已经搞清了,不过如果要求再严格一点,恐怕就没这么简单了.传送门在此using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Text.RegularExpressions;namespace MyConsoleLab{原创 2012-02-07 14:09:16 · 739 阅读 · 0 评论 -
Scheme 和 ZOJ
今天尝试使用Scheme来解决ZOJ上的问题,花费了好些时间才通过1001的测试,记下来做个纪念 (define is-loop #t)(define (print) (let ((x (read)) (y (read))) (if (and (not (eof-object? x)) (not (eof-object? y))) (原创 2012-03-23 14:37:00 · 693 阅读 · 0 评论