扩展欧几里得算法c++
时间: 2023-10-06 21:06:56 浏览: 268
欧几里德算法和扩展欧几里德算法。用C和C++实现。.zip
扩展欧几里得算法是用来解决线性同余方程的一种方法。它可以找到整数x和整数y,使得ax + by = gcd(a, b)成立。这个算法通过递归的方式,不断地进行辗转相除,直到找到最大公约数。在每一步中,我们更新x和y的值,使得等式成立。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [扩展欧几里得算法 C++ ( 原来还可以这样做 tql )](https://blog.csdn.net/qq_51277605/article/details/118032597)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [【算法学习】扩展欧几里得算法详解及C++代码实现](https://blog.csdn.net/u014117943/article/details/108428551)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文