Program 1
#include
using namespace std;
int main() {
int n = 5;
int p = 1;
int input;
for (int i = 0; i < n; i++) {
cout
cin >> input;
p *= input;
}
cout
cin >> n; // for pause
return 0;
}
Program 2
#include
using namespace std;
int main() {
int n;
int p = 0;
int input;
cout
cin >> n;
for (int i = 0; i < n; i++) {
cout
cin >> input;
p += input;
}
cout
cin >> n; // for pause
return 0;
}
Program 3
#include
using namespace std;
int main() {
int n;
int count = 0;
int input;
cout
cin >> n;
for (int i = 0; i < n; i++) {
cout
cin >> input;
if(input < 0) count ++;
}
cout
cin >> n; // for pause
return 0;
}