December 31, 2010

c語言程式 算面積

算面積(公尺轉尺)


#include
#include
int main (void)
{
    float a,a1,b,b1,m,e;
    
    printf("請輸入長度:",m);
    scanf("%f",&a);
    a1=a*3.3;
    printf("請輸入寬度:",m);
    scanf("%f",&b);
    b1=b*3.3;
    e=a1*b1/36.0;
    printf("坪數:%f",e);
    scanf("%f",&e);
    
    system("pause");
    return 0;
}
算面積(英呎轉尺)
 

#include
#include
int main (void)
{
    float a,a1,a2,a3,a4,b,b1,b2,b3,c,c1,c2,c3,c4,d,d1,d2,d3,ft,in,e;
    
    printf("請輸入長度(英呎):",ft);
    scanf("%f",&a);
    a1=a*12;
    a2=a1*2.54;
    a3=a2*0.01;
    a4=a3*3.3;
    printf("請輸入長度(英吋):",in);
    scanf("%f",&b);
    b1=b*2.54;
    b2=b1*0.01;
    b3=b2*3.3;
    printf("請輸入寬度(英呎):",ft);
    scanf("%f",&c);
    c1=c*12;
    c2=c1*2.54;
    c3=c2*0.01;
    c4=c3*3.3;
    printf("請輸入寬度(英吋):",in);
    scanf("%f",&d);
    d1=d*2.54;
    d2=d1*0.01;
    d3=d2*3.3;
    e=(a4+b3)*(c4+d3)/36.0;
    printf("坪數:%f",e);
    scanf("%f",&e);
    
    system("pause");
    return 0;
}

0推薦此文章
Today's Visitors: 0 Total Visitors: 18
Personal Category: c語言程式 Topic: learning / education / linguistic
Previous in This Category: c語言程式 國英數成績平均的計算   Next in This Category: c語言程式 檢查身分證字號
[Trackback URL]

Reply
  • 嗯..不會

  • Blog Owner at March 29, 2011 06:45 PM Reply
Post A Comment









Yes No



Please input the magic number:

( Prevent the annoy garbage messages )
( What if you cannot see the numbers? )
Please input the magic number

誰來收藏
Loading ...
unlog_NVPO 0