Sign in
or
Register
Courses
Textbook
Compiler
Contests
Topics
Courses
Arithmetic
GCD (Greatest Common Divisor)
Module:
GCD (Greatest Common Divisor)
Problem
2
/10
Long gcd
Problem
Two numbers are given. Find their greatest common divisor.
Input data
Two natural numbers not exceeding 10
9
are entered.
Imprint
Output the GCD of the entered numbers.
Examples
#
Input
Output
1
42 12
6
1000
ms
256 Mb
Rules for program design and list of errors in automatic problem checking
Teacher commentary