#include <stdio.h> int main() { int a, b; int min; scanf_s("%d %d", &a, &b); if (a > b) min = b; else min = a; for (int i = min; i >= 0; i--) { if (a%i == 0 && b%i == 0) { printf("%d", i); break; } } return 0; }
2023-12-03 15:51:16
#include <stdio.h> int main() { int a, b; int min; scanf_s("%d %d", &a, &b); if (a > b) min = b; else min = a; for (int i = min; i >= 0; i--) { if (a%i == 0 && b%i == 0) { printf("%d", i); break; } } return 0; }