Website Summary Files Commits Branches @commit @diff @stats
path: root / pract_SI / pract. 03 / Solutions / task7.cpp
diff options
context:
space:
mode:
Commite3a09fd1513ace582cbeab8e0de94046b8d6d429 (patch)
Author
 Justsvetoslavov <justsvetoslavov@gmail.com>
2021-10-25 17:14:51 +0300
Committer
 Justsvetoslavov <justsvetoslavov@gmail.com>
2021-10-25 17:14:51 +0300
Filese13d583c2343b2790c4d526c286c09f1c7b3e072 /pract_SI/pract. 03/Solutions/task7.cpp
Introduction_to_programming_FMI-e3a09fd1513ace582cbeab8e0de94046b8d6d429.tar
Introduction_to_programming_FMI-e3a09fd1513ace582cbeab8e0de94046b8d6d429.tar.gz
Introduction_to_programming_FMI-e3a09fd1513ace582cbeab8e0de94046b8d6d429.zip
Parentbd4c67c66dd204c602d252fcd2435c0598b903a8 (diff)
Fixed Limit. Fixed Loop
1 files changed, 3 insertions, 3 deletions
-rw-r--r--pract_SI/pract. 03/Solutions/task7.cpp6
diff --git a/pract_SI/pract. 03/Solutions/task7.cpp b/pract_SI/pract. 03/Solutions/task7.cpp
index b02cd7a..aa9194b 100644
--- a/pract_SI/pract. 03/Solutions/task7.cpp
+++ b/pract_SI/pract. 03/Solutions/task7.cpp
@@ -13,12 +13,12 @@ int main()
unsigned long long N;
cin >> N;
- if (N <= LIMIT)
+ if (N < LIMIT)
return -1;
for (int c = 1; c <= N; c++) {
- for (int b = 1; b <= c; b++) {
- for (int a = 1; a <= b; a++) {
+ for (int b = 1; b < c; b++) {
+ for (int a = 1; a < b; a++) {
if ((a * a) + (b * b) == (c * c)) {
cout << a << SEPARATOR << b << SEPARATOR << c << endl;
}