#include <iostream>
using namespace std;
int main() {
setlocale(LC_ALL, "Rus");
int s_ch = 0, pr_nch = 1;
for (int i = 2; i <= 100; i += 2)
s_ch += i;
for (int i = 1; i <= 100; i += 2)
pr_nch += i;
cout << "Сумма четных: " << s_ch << "\n";
cout << "Произведение нечетных: " << pr_nch;
return 0;
}
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
using namespace std;
int main() {
setlocale(LC_ALL, "Rus");
int s_ch = 0, pr_nch = 1;
for (int i = 2; i <= 100; i += 2)
s_ch += i;
for (int i = 1; i <= 100; i += 2)
pr_nch += i;
cout << "Сумма четных: " << s_ch << "\n";
cout << "Произведение нечетных: " << pr_nch;
return 0;
}