当前位置:网站首页>An elegant program for Euclid‘s algorithm
An elegant program for Euclid‘s algorithm
2022-07-05 03:44:00 【Grand mage yunzhongjun】
// Euclid's algorithm for greatest common divisor
int euclidAlgorithm (int A, int B){
A=abs(A);
B=abs(B);
while (B!=0){
while (A>B) A=A-B;
B=B-A;
}
return A;
}
边栏推荐
- JWT漏洞复现
- Une question est de savoir si Flink SQL CDC peut définir le parallélisme. Si le parallélisme est supérieur à 1, il y aura un problème d'ordre?
- Use of kubesphere configuration set (configmap)
- SQL performance optimization skills
- Binary heap implementation (priority queue implementation)
- 有個疑問 flink sql cdc 的話可以設置並行度麼, 並行度大於1會有順序問題吧?
- 天干地支纪年法中为什么是60年一个轮回,而不是120年
- Accuracy problem and solution of BigDecimal
- [untitled]
- Is there any way to change the height of the uinavigationbar in the storyboard without using the UINavigationController?
猜你喜欢
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Redis之Jedis如何使用
JWT漏洞复现
A brief introduction to the behavior tree of unity AI
An elegant program for Euclid‘s algorithm
ABP vNext microservice architecture detailed tutorial - distributed permission framework (Part 2)
Quick start of UI component development of phantom engine [umg/slate]
IPv6 experiment
Containerization Foundation
[groovy] string (string type variable definition | character type variable definition)
随机推荐
How can we truncate the float64 type to a specific precision- How can we truncate float64 type to a particular precision?
Subversive cognition: what does SRE do?
SQL injection exercise -- sqli Labs
LeetCode 234. Palindrome linked list
Machine learning experiment report 1 - linear model, decision tree, neural network part
Anchor free series network yolox source code line by line explanation Part 2 (a total of 10, ensure to explain line by line, after reading, you can change the network at will, not just as a participan
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
grandMA2 onPC 3.1.2.5的DMX参数摸索
Daily question 2 12
Class inheritance in C #
Multimedia query
Ask, does this ADB MySQL support sqlserver?
JWT vulnerability recurrence
How to learn to get the embedding matrix e # yyds dry goods inventory #
Asemi rectifier bridge 2w10 parameters, 2w10 specifications, 2w10 characteristics
Nmap使用手册学习记录
Easy processing of ten-year futures and stock market data -- Application of tdengine in Tongxinyuan fund
The architect started to write a HelloWorld
Anti debugging (basic principles of debugger Design & NT NP and other anti debugging principles)
[C language] address book - dynamic and static implementation