Browse Source

Add 'D.cpp'

webturing 4 years ago
parent
commit
7af6d710e8
1 changed files with 17 additions and 0 deletions
  1. 17 0
      D.cpp

+ 17 - 0
D.cpp

@@ -0,0 +1,17 @@
+#include<bits/stdc++.h>
+using namespace std;
+int gcd(int a,int b){
+    while(b>0){
+        int c=a%b;
+        a=b;
+        b=c;
+    }
+    return a;
+}
+int main(){
+    int a,b;
+    cin>>a>>b;
+    cout<<gcd(a,b);
+     
+    return 0;
+}