My issue
What is wrong with this code?
My code
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
for(int i=1;i<t+1;i++){
int a,o;
cin>>a>>o;
int c=min(a,o);
int max_no=1;
for(int j=2;j<=c;j++){
if(a%j==0 && o%j==0){
max_no=j;
}
}
cout<<max_no<<endl;
}
return 0;
}
Problem Link: APPLEORANGE Problem - CodeChef