Free Pascal 错误!program exa2012_7;var a,b,c:real;beginread(a,b,c);if a+b>c and b+c>a and a+c>bthen if a*a+b*b=c*c or a*a+c*c=b*b or b*b+c*c=a*a]then write('It is a right triangle.')else write('It is a normal triangle.')else write('It can not be a

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 11:43:38
FreePascal错误!programexa2012_7;vara,b,c:real;beginread(a,b,c);ifa+b>candb+c>aanda+c>bthenifa*a+b*b=c*

Free Pascal 错误!program exa2012_7;var a,b,c:real;beginread(a,b,c);if a+b>c and b+c>a and a+c>bthen if a*a+b*b=c*c or a*a+c*c=b*b or b*b+c*c=a*a]then write('It is a right triangle.')else write('It is a normal triangle.')else write('It can not be a
Free Pascal 错误!
program exa2012_7;
var a,b,c:real;
begin
read(a,b,c);
if a+b>c and b+c>a and a+c>b
then if a*a+b*b=c*c or a*a+c*c=b*b or b*b+c*c=a*a]
then write('It is a right triangle.')
else write('It is a normal triangle.')
else write('It can not be a triangle.')
end;
end.
编写程序,输入3个数,分别代表三角形的三条边长,判断能否组成三角形(triangle),如果能,判断是直角三角形(right triangle)还是普通三角形(normal triangle),在屏幕上输出判断结果.

Free Pascal 错误!program exa2012_7;var a,b,c:real;beginread(a,b,c);if a+b>c and b+c>a and a+c>bthen if a*a+b*b=c*c or a*a+c*c=b*b or b*b+c*c=a*a]then write('It is a right triangle.')else write('It is a normal triangle.')else write('It can not be a
判断的式子要加括号……
例如:a+b>c→(a+b>c);a*a+b*b=c*c→(a*a+b*b=c*c).
明白了么?
var a,b,c:real;
begin
read(a,b,c);
if(a+b>c)and(b+c>a)and(a+c>b)
then if(a*a+b*b=c*c)or(a*a+c*c=b*b)or(b*b+c*c=a*a)
then write('It is a right triangle.')
else write('It is a normal triangle.')
else write('It can not be a triangle.')
end.