Skip to content

Commit b8398fd

Browse files
committed
added day3q2
1 parent 7c850b1 commit b8398fd

5 files changed

Lines changed: 22 additions & 0 deletions

File tree

.DS_Store

0 Bytes
Binary file not shown.

Problems/.DS_Store

2 KB
Binary file not shown.

Problems/Mathematics/.DS_Store

2 KB
Binary file not shown.
0 Bytes
Binary file not shown.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main(){
5+
ios::sync_with_stdio(false);
6+
cin.tie(nullptr);
7+
8+
long long a,b;
9+
cin>>a>>b;
10+
11+
long long ans=0;
12+
while(b){
13+
ans+=a/b;
14+
a%=b;
15+
long long t=a;
16+
a=b;
17+
b=t;
18+
}
19+
20+
cout<<ans;
21+
return 0;
22+
}

0 commit comments

Comments
 (0)