为什么暴力一一枚举都可以?
#include <bits/stdc++.h> using namespace std; int main() { int x, y, z; cin >> x >> y >> z; for(int i = min(x, min(y, z)); i >= 1 ; i --) { if (!(x % i) && !(y % i) && !(z % i)) { cout << i; return 0; } } return 0; }
求解