题解 | #小乐乐与欧几里得#
小乐乐与欧几里得
https://www.nowcoder.com/practice/da13e0cf321e4df9acd0fdf0a433cbb0
#include <stdio.h> int main() { long long int a = 0; long long int b = 0; long long int c = 0; long long int d = 0;//a * b long long int e = 0;//最终结果 scanf("%lld %lld", &a, &b);//输入 d = a * b; while(a % b) { c = a % b; a = b; b = c; } e = b + d / b;//公约数和公倍数之和 printf("%lld\n", e); return 0; }
C语言基础 文章被收录于专栏
里面较为详细的介绍了c语言的相关用法和有关题目。