
其他
hu的小金库
正在编程路上走
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
欧几里得和扩展欧几里得!!!
欧几里得:是求两个数的最大公约数:int gcd(int a, int b){ if(b==0) return a; return gcd(b, a%b);}扩展欧几里得:已知a,b求解二元一次方程ax+by=gcd(a,b)的一组解(x,y);int exgcd(int a,int b,int &x,int &y){ ...原创 2018-10-07 10:28:33 · 172 阅读 · 0 评论 -
最小公倍数--辗转相除法
#include <stdio.h>#include <string.h>#include <stdlib.h> int main(){ int n, m, a, b, c; while(~scanf("%d%d", &m, &n)) { a = m; b = n; ...原创 2018-08-20 10:55:22 · 276 阅读 · 0 评论 -
计算程序运行时间!!!
#include<iostream>#include<time.h>int main(){ clock_t start_time=clock(); { //被测试代码 } clock_t end_time=clock(); cout<< "Running time is: "<<stat...原创 2018-09-20 21:12:00 · 275 阅读 · 0 评论