c語言用if語句程式設計實現輸入數值判斷能否

2021-03-04 02:32:14 字數 581 閱讀 4914

1樓:天雨下凡

#include

#include

int main(void)

else

printf("%f,%f,%f不能構造三角形\n",a,b,c);

printf("\n");

return 0;}

2樓:匿名使用者

#include "stdio.h"

#include "math.h"

int main()

p=(a+b+c)/2;

s=sqrt(p*(p-a)*(p-b)*(p-c));

printf("三角形的三邊是:%f %f %f ",a,b,c);

printf("面積是: %f \n",s);

return 0;}

輸入三角形任意三條邊,判斷是否能夠成三角形,如果可以構成三角形求面積c語言

3樓:兄弟連教育北京總校

#include

void main()

else

}getch();}

C語言程式設計if語句,用C語言程式設計中if語句的格式是什麼?

printf t f n w h h 你程式中根本就沒有對變數t賦值,這句t f放在printf中,只是當作表面上的字串顯示而已。並不會對t賦值。scanf f f h,w t w h h printf t f n t include include int main 沒有給t值賦值,在printf...

c語言中應用switch語句程式設計輸入

int n switch n case 1 printf 今天襲是週一 break case 2 printf 今天是週二 break case 3 printf 今天是週三 break case 4 printf 今天是週四 break case 5 printf 今天是週五 break case...

C語言程式設計 程式設計實現根據以下函式關係,對輸入的每個x值,並

double y double x,double a c語言程式設計 程式設計實現根據以下函式關係,對輸入的每個x值,計算並輸出y的值 include stdio.h int main void include int main double y double x,double a c語言程式設計 ...