2 solutions

  • 3
    @ 2025-6-6 16:47:27
    #include<bits/stdc++.h>
    using namespace std;
    
    int main() {
        int a, b, c; cin >> a >> b >> c;
        if(a > b)  swap(a, b);
        if(a > c)  swap(a, c);
        if(b > c)  swap(b, c);// 排序 a, b, c
        cout << a / __gcd(a, c) << "/" << c / __gcd(a, b); // 约分
        return 0;
    }
    
    
    • 0
      @ 2025-12-23 17:42:45

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

      int main() { int a, b, c; cin >> a >> b >> c; if(a > b) swap(a, b); if(a > c) swap(a, c); if(b > c) swap(b, c);// 排序 a, b, c cout << a / __gcd(a, c) << "/" << c / __gcd(a, b); // 约分 return 0; }

      • 1

      Information

      ID
      1352
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      5
      Tags
      # Submissions
      57
      Accepted
      24
      Uploaded By