Ответ:
1.
#include <iostream>
using namespace std;
int main() {
int N;
int sum=0;
cout << "Enter number N: ";
cin >> N;
for (int i = 0; i <= N; i++) {
if (i % 3 == 0) sum += i;
}
cout << "Result: " << sum;
=====================================
2.
cout << i*i*i<<endl;
Объяснение:
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
1.
#include <iostream>
using namespace std;
int main() {
int N;
int sum=0;
cout << "Enter number N: ";
cin >> N;
for (int i = 0; i <= N; i++) {
if (i % 3 == 0) sum += i;
}
cout << "Result: " << sum;
}
=====================================
2.
#include <iostream>
using namespace std;
int main() {
int N;
cout << "Enter number N: ";
cin >> N;
for (int i = 0; i <= N; i++) {
cout << i*i*i<<endl;
}
}
Объяснение: