pascalabcnet/TestSuiteAdditionalLanguages/SPythonTests/CompilationSamples/compound_conditions_example.pys
Александр Земляк 17f6a9b956
Spython test suite (#3362)
* Reorganize files in TestSuite dir for multiple languages

* Add SPython samples to TestSuite

* Update TestRunner to support multiple languages

* Delete dll files accidentally pushed

* Update .gitignore

* Revert "Delete dll files accidentally pushed"

This reverts commit 62bcba2b821d58ae51ec98e9dadcf621bb0fc003.

* Update testing dir path in Testing.cs

* Improve TestRunner output

* Add random module and it's usage sample

* Reorganize gitignore files

* Move pascal tests back to TestSuite and create new TestSuiteLanguagePlugins folder for SPython

* Revert "Update testing dir path in Testing.cs"

This reverts commit 7d94eafb25292421bce8315520b4f6a0de001bbd.

* Revert crlf changes in pascal tests

* Test changes of _RebuildReleaseAndRunTestsForGitHubActions.bat

* Revert "Test changes of _RebuildReleaseAndRunTestsForGitHubActions.bat"

This reverts commit 234ceae3e3a339fbc68a6170e2bd201dab14d67d.

* Test changes in StorageLocationPicker

* Another test changes in StorageLocationPicker.cs

* Rename LanguagePlugins folder to AdditionalLanguages

* Decouple TestRunner from language names and parameters

* Revert calling TestRunner without parameters in .bat files

* Fix formatter tests nogui exception handling

* Small refactoring in Testing.cs and TestRunner fix of working directory
2025-12-21 21:11:52 +03:00

27 lines
774 B
Plaintext

N = 7
# Выводит первые N чисел,
# которые можно тремя различными
# способами представить как
# сумму двух квадратов целых чисел
def print_sequence(N: int):
a = 0
while True:
a += 1
for b in range(1, a):
for c in range(1, b):
for d in range(1, c + 1):
for e in range(1, d):
for f in range(1, e):
if a ** 2 + f ** 2 == b ** 2 + e ** 2 == c ** 2 + d ** 2:
print(a ** 2 + f ** 2, '\t= ',
a, '^2 + ', f, '^2 \t= ',
b, '^2 + ', e, '^2 \t= ',
c, '^2 + ', d, '^2', sep='')
N -= 1
if N == 0:
return
print_sequence(N)