Run ID:91017
提交时间:2024-09-20 22:04:38
#include<iostream> using namespace std; int f(int m, int n){ int min = (m <= n)?m:n; for(int i = min; i >= 1; i--){ if(m % i == 0 && n % i ==0) return i; } } int fu(int m, int n){ int max = (m >= n)?m:n; int i = max; while (i % m != 0 || i % n != 0) { i++; } return i; }