Ответ:
Объяснение:
#include <iostream>
using namespace std;
void cycle_for() {
int sum = 0;
for (int i = 0; i <= 80; i++) if (i % 4 == 0) sum += i;
cout << "Cycle for: " << sum << endl;
}
void cycle_while() {
int i = 0, sum = 0;
while (i <= 80) {
if (i % 4 == 0) sum += i;
i++;
cout << "Cycle while: " << sum << endl;
void cycle_do_while() {
do {
} while (i <= 81);
cout << "Cycle do while: " << sum;
int main() {
cycle_for();
cycle_while();
cycle_do_while();
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
Объяснение:
#include <iostream>
using namespace std;
void cycle_for() {
int sum = 0;
for (int i = 0; i <= 80; i++) if (i % 4 == 0) sum += i;
cout << "Cycle for: " << sum << endl;
}
void cycle_while() {
int i = 0, sum = 0;
while (i <= 80) {
if (i % 4 == 0) sum += i;
i++;
}
cout << "Cycle while: " << sum << endl;
}
void cycle_do_while() {
int i = 0, sum = 0;
do {
if (i % 4 == 0) sum += i;
i++;
} while (i <= 81);
cout << "Cycle do while: " << sum;
}
int main() {
cycle_for();
cycle_while();
cycle_do_while();
}