Heronian triangles: Difference between revisions
m
→{{header|FutureBasic}}: Remove unsupported 'ConsoleWindow'
(→{{header|C++}}: C++11 to C++17 (basically just using std::gcd)) |
m (→{{header|FutureBasic}}: Remove unsupported 'ConsoleWindow') |
||
Line 2,033:
=={{header|FutureBasic}}==
<syntaxhighlight lang="futurebasic">
text,,,,,70// Set width of tabs▼
▲// Set width of tabs
local fn gcd( a as long, b as long )
dim as long result
if ( b != 0 )
result = fn gcd( b, a mod b)
else
result = abs(a)
end if
end fn = result
Line 2,053 ⟶ 2,050:
local fn CalculateHeronianTriangles( numberToCheck as long ) as long
dim as long c, b, a, result, count : count = 0
dim as double s, area
for c = 1 to numberToCheck
for b = 1 to c
for a = 1 to b
next
next
next
end fn = count
Line 2,090 ⟶ 2,087:
print "---------------------------------------------"
print "Side A", "Side B", "Side C", "Perimeter", "Area"
print "---------------------------------------------"
// Sort array
dim as Boolean flips : flips = _true
while ( flips = _true )
flips = _true
wend
// Find first 10 heronian triangles
for i = 1 to 10
next
print
Line 2,115 ⟶ 2,112:
// Search for triangle with area of 210
for i = 1 to count
next
HandleEvents
</syntaxhighlight>
|