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