Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include <iostream>
#include <string>
using namespace std;
int main() {
string s1, s2;
cin >> s1 >> s2;
if(s1 == s2)
cout << s1 << endl;
else
cout << 1 << endl;
return 0;
}
Copy The Code &
Try With Live Editor
Input
1 2
Output
1
Demonstration
Codeforces Solution-Complicated GCD-Solution in C, C++, Java, Python