//************************************************************* // NAME: Gordon Chiu // K-SECTION: xx // Watstar ID: grchiu@engmail // ID: 00xxxxxx // DEPARTMENT: COMPUTER ENGINEERING // TEACHING ASSISTANT: xxxxxx // // ASSIGNMENT: 5 // QUESTION: 1 // DATE: October 11 2000 // // PROGRAM DESCRIPTION: // This program calculates the Greatest Common Divisor // of two numbers. // // I declare that, other than listed below, this program // is my original work. // // // _____________________________________ ( signature ) // //**************************************************************** #include int main() while (2==scanf("%d %d",&(int a),&(int b))) printf("%d\n",gcd(a,b)); int gcd(int a, int b) return b==0?a:gcd(b, a%b);