1) #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> arr;
int N;
int sum = 0;
cin >> N;
for(int i = 0; i<N; ++i) {
int temp;
cin >> temp;
arr.push_back(temp);
if(i==0) {
sum = arr[i];
} else {
sum*=arr[i];
}
cout << "Sum: " << sum;
2) #include <iostream>
int sum2(0), sum3(0);
if(arr[i]>9&&arr[i]<100) {
if(sum2==0) {
sum2=arr[i];
sum2*=arr[i];
if(arr[i]>99&&arr[i]<1000) {
sum3+=arr[i];
cout << "Sum2: " << sum2 << endl << "Sum3: " << sum3;
1) #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> arr;
int N;
int sum = 0;
cin >> N;
for(int i = 0; i<N; ++i) {
int temp;
cin >> temp;
arr.push_back(temp);
if(i==0) {
sum = arr[i];
} else {
sum*=arr[i];
}
cout << "Sum: " << sum;
}
2) #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> arr;
int N;
cin >> N;
int sum2(0), sum3(0);
for(int i = 0; i<N; ++i) {
int temp;
cin >> temp;
arr.push_back(temp);
if(arr[i]>9&&arr[i]<100) {
if(sum2==0) {
sum2=arr[i];
} else {
sum2*=arr[i];
}
} else {
if(arr[i]>99&&arr[i]<1000) {
sum3+=arr[i];
}
}
}
cout << "Sum2: " << sum2 << endl << "Sum3: " << sum3;
}