您的位置首页百科问答 用gcd求最大公约数 c语言 Simone 发布于 2023-07-03 05:01:28 650 阅读 要返回值。#includevoid main(){ int a,b,c; int gcd(int,int); printf("input 戚祥two integers:"孝仔答); scanf("%d%d",&a,&b); c=gcd(a,b); printf("Greatest common divisor 巧慧is %d\n",c);}int gcd(int x,int y){ int t; while(y) { t=x%y; x=y; y=t; } return x;}