题解 | #小乐乐与欧几里得#
小乐乐与欧几里得
http://www.nowcoder.com/practice/da13e0cf321e4df9acd0fdf0a433cbb0
#include <stdio.h> int main() { long long n = 0; long long m = 0; scanf("%lld %lld", &n, &m); long long a = n; long long b = m; int t = 0; while (t = a % b) { a = b; b = t; } printf("%lld\n", b + m * n / b); return 0; }
编程初学者入门训练 文章被收录于专栏
针对编程初学者入门训练130题的代码详解专栏,内附注释方便理解,牛客130题的代码均用C语言实现,方便初学者学习。