![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 65
swabc
这个作者很懒,什么都没留下…
展开
-
求最大公约数,最大公倍数
/* 函数功能 :用递归法求两个非负数的最大公约数 2007.1.23 */ int gcd (int a,int b) { if (b == 0) { return a; } else { gcd(b,a%b); } } /* 函数功能 : 用循环法求两个非负数的最大公约数 2007.1.23 */ int gcd (int a,int b) { int temp; while (b !=原创 2007-01-24 00:13:00 · 1245 阅读 · 0 评论 -
改进的冒泡排序算法实现 (C#)
using System;class BubblesSort...{ static void Main() ...{ int [] data = new int[] ...{8,3,2,1}; bubblessort(data, data.Length); for (int i = 0; i data.Length; i++)原创 2007-05-27 21:34:00 · 576 阅读 · 0 评论 -
Cohen-SutherLand 裁剪算法 (vc++)
Cohen-SutherLand实现裁剪直线的两个关键函数 //计算点 x,y的编码void CCohenSutherLandView::CompOutCode(float x,float y,CRect* rect,OutCode* outCode){ outCode->all = 0; outCode->top = outCode->bottom =0; if (y top) {原创 2007-05-27 21:19:00 · 4136 阅读 · 0 评论