1. Consider the following sample code which implements the Bubble Sort.
    void bubble_sort(int A[], int n) {
        int temp;
        for (int i=0; i<n; i++)
            for (int j=0; j<n-1; j++)
                if (A[j] > A[j+1]) {
                    temp = A[j];
                    A[j] = A[j+1];
                    A[j+1] = temp;
                }
    }
    
    int main()
    {
        int A[N];
        read_integers(A, N);
        print_integers(A, N);
        bubble_sort(A, N);
        print_integers(A, N);
        return 0;
    }
  2. Modify it so that it can handle the sorting of rational numbers.
    struct Rational {
        int numerator;      // 分子
        int denominator;    // 分母
    };
  3. Your main function may look like:
    int main()
    {
        Rational A[N] = { {10, 9}, {8, 7}, {6, 5}, {4, 3}, {2, 1},
                          {1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10} };
    
        print_rationals(A, N);
    
        bubble_sort(A, N);
        print_rationals(A, N);
    
        return 0;
    }