3-10(判断三角形并输出面积)
2015-04-23 18:06
246 查看
<pre name="code" class="cpp"><span style="font-size:24px;">/* Note:Your choice is C IDE */ #include "stdio.h" int judge(int a,int b, int c) { int S,k; if(a+b>c&&a+c>b&&b+c>a) { printf("OK!\n"); S=(a+b+c)/2; printf("该三角形面积为:%d\n",S); } else { printf("Wrong! please insert again:\n"); k=0; } return k; } void main() { int a,b,c,k; k=0; do { printf("please input 3 ints:\n"); scanf("%d %d %d",&a,&b,&c); judge(a,b,c); }while(k=1); }</span>
相关文章推荐
- 输入三角形的三边长为a,b,c判断a,b,c能否构成一个三角形,并且输出其面积。
- if else 应用之经典例题判断能否构成三角形并输出面积
- C语言 输入三角形的三边,判断三角形的类型,并输出它的类型和面积
- C语言-根据输入的三角形的三条边判断三角形的类型,并输出它的面积和类型
- 判断能否构成三角形 并输出三角形的周长和面积
- 从键盘任意输入三角形的三边长为a,b,c,编程判断a,b,c的值能否构成一个三角形,若能,请算出面积·若不能就输出不能构成三角形。
- 12月27日任务 从键盘任意输入三角形的三边,判断是否能构成三角形,若能,则计算三角形的面积并输出,若不能,则输出不能构成三角形
- P122 第三章 10题 三角形的面积及三边是否能组成三角形的判断
- C语言输入三角形边长判断其类型并输出面积实例代码
- 输入三个坐标,判断能否构成三角形,如果能,输出其周长和面积。
- 判断是否能构成三角形并计算面积
- 判断三角形的面积及类型(多重选择)
- 计算三角形的面积,并判断三角形的类型?
- c语言:任给三条边长,判断能否构成三角形,如果能,求出其面积和周长
- 7-8 输出三角形面积和周长(15 分)
- 利用5个标签,4个文本框,2个按钮,自己设计布局实现输入三边求三角形面积。界面如下所示。三角形类的编写可以使用实验4中已经写过的三角形类,当点击“判断三边”时,若能构成三角形,在标签5上显示“可以构成三角形!”,如不能构成三角形,在标签5上显示“不能构成三
- C#语言-输入三角形或者长方形边长,计算其周长和面积并输出
- 【无聊】判断一点是否在三角形内。(面积法)
- 判断一个三角形并求面积
- 6-4 三角形类(求面积,周长,判断直角,等腰...)