2024-04-12|閱讀時間 ‧ 約 21 分鐘

code

    1.計算橢圓面積

    這一題在寫作可以分成三個部分:標頭檔、主程式、函式

    標頭檔:

    #include<stdio.h>

    #define PI 3.14156778565

    韓式:

    float calculateellipsearea(float a, float b){

    float area = PI * a * b;

    return area;

    }


    主程式:

    int main(){

         float a, b;

    float area;


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

    area = calculateellipsearea(a, b);

    printf("%.3f", area);

         return 0;

    }


    分享至
    成為作者繼續創作的動力吧!
    這裡是一個存放想法的倉庫,而且有一點亂,想用來做文字的工程
    從 Google News 追蹤更多 vocus 的最新精選內容從 Google News 追蹤更多 vocus 的最新精選內容

    Lin harry的沙龍 的其他內容

    發表回應

    成為會員 後即可發表留言
    © 2024 vocus All rights reserved.