首頁>Club>
6
回覆列表
  • 1 # 恭喜發財179334006


    void sum_diff( float op1, float op2, float *psum, float *pdiff );

    其中op1和op2是輸入的兩個實數,psum和pdiff是計算得出的和與差。

    程式碼

    #include <stdio.h>

    void sum_diff( float op1, float op2, float *psum, float *pdiff );

    int main()

    {

    float a, b, sum, diff;

    scanf("%f %f", &a, &b);

    sum_diff(a, b, &sum, &diff);

    printf("The sum is %.2f\nThe diff is %.2f\n", sum, diff);

    return 0;

    }

    void sum_diff( float op1, float op2, float *psum, float *pdiff )

    {

    *psum=op1+op2;

    *pdiff=op1-op2;

    }

  • 中秋節和大豐收的關聯?
  • 與西醫相比中醫的就業優勢?