标签:
#include "stdafx.h" #include <iostream> using namespace std; int main() { int a, b, c, i; cout << "请输入两个数:"; cin >> a; cin >> b; for (i = a; i>1; i--) { if (a%i == 0 && b%i == 0) { cout << a << "和" << b << "的最大公约数是:" << i << endl; } break; } getchar(); return 0; }
标签:
原文地址:http://www.cnblogs.com/520wy/p/5598243.html