Thursday, September 27, 2018

Solution of URI 1028::Collectable Cards

Before seeing the solution make sure that you have tried enough. Don’t copy the whole code, just find out the logic. If you feel any problemyou will inform me by comment.




#include <bits/stdc++.h>
using namespace std;

int main(){
    int N,F1,F2,result;
    cin>>N;

    while(N--){
        cin>>F1>>F2;
        result =__gcd(F1,F2);
        cout<<result<<endl;
    }
    return 0;
}

No comments:

Post a Comment