Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int t,a,b;
- int miojo(int amp1, int amp2){
- if(amp1==t || amp2==t){
- return t;
- }
- else
- if(amp1>amp2){
- return amp2+miojo(amp1-amp2,amp2);
- }
- else{
- return amp1+miojo(amp1,amp2-amp1);
- }
- }
- int main(){
- cin>>t>>a>>b;
- int tempo = miojo(a,b);
- cout<<tempo<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement