Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///B.2. Degustare de ciocolată
- https://www.cs.ubbcluj.ro/wp-content/uploads/Model-Informatica-Admitere-2019-RO.pdf
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int n,k,r,a,b;
- cin>>n>>k;
- a=n;
- b=k;
- while(b!=0)
- {
- r=a%b;
- a=b;
- b=r;
- }
- //cmmdc=a
- cout<<n-n/a;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement