To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 96eea3d9 authored by Erick Turricelli's avatar Erick Turricelli
Browse files

Ex2: case n > n_max

parent 78eea530
......@@ -12,6 +12,10 @@ int main() {
std::cout << "Select the number of elements you want to insert\n";
std::cin >> n;
// consider the case of n > n_max
if (n > n_max) {
std::cout << "Max number of elements excedeed, please insert n <= n_maax \n";
}
std::cout << "Static approach\n";
double sum = 0;
for (unsigned int i=0; i<n; i++) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment