您的位置:首页 > 其它

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>




内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐