fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <cstdio>
  4. using namespace std;
  5.  
  6. int main() {
  7. int a, b;
  8. scanf("%d %d", &a, &b);
  9. int gcd = __gcd(a, b);
  10. printf("%d/%d\n", a/gcd, b/gcd);
  11. return 0;
  12. }
Success #stdin #stdout 0.01s 3300KB
stdin
8 12
stdout
2/3