Skip to content

Commit 93f7d92

Browse files
Create 21hcf.cpp
1 parent 9ba4470 commit 93f7d92

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

21hcf.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
int main(){
4+
int n;
5+
int m;
6+
cin>>n;
7+
cin>>m;
8+
while(m!=n){
9+
if(m>n){
10+
m=m-n;
11+
}
12+
else{
13+
n=n-m;
14+
}
15+
}
16+
cout<<m;
17+
18+
19+
20+
return 0;
21+
}

0 commit comments

Comments
 (0)