Altered
This commit is contained in:
12
Algorithm/Maths/NumberTheory/gcd.cpp
Normal file
12
Algorithm/Maths/NumberTheory/gcd.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
int gcd(int a, int b){
|
||||
if(b == 0) return a;
|
||||
return gcd(b, a % b);
|
||||
}
|
||||
int main(){
|
||||
int a, b;
|
||||
cin >> a >> b;
|
||||
cout << gcd(a, b) << endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user