Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int GCD(int a, int b);
- int main() {
- int a, b;
- cin >> a >> b;
- cout << GCD(a, b);
- return 0;
- }
- int GCD(int a, int b) {
- if (b == 0)
- return a;
- else
- return GCD(b, a%b);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement