C++题解
#include <iostream> using namespace std; int main() { int m, n, r; cin>>m>>n; while (n != 0) { r = m%n; m = n; n = r; } cout<<m<<endl; return 0; }
#include <iostream> using namespace std; int main() { int m, n, r; cin>>m>>n; while (n != 0) { r = m%n; m = n; n = r; } cout<<m<<endl; return 0; }
相关推荐