Answer the question
In order to leave comments, you need to log in
Why is it unclear to me and how to fix it?
The replacement is correct (I checked it step by step), but the conclusion is not the same
#include<iostream>
#include <cstring>
#include<cmath>
#include<cstdlib>
#include<conio.h>
using namespace std;
int main()
{
setlocale(LC_ALL, "RUS");
const int n = 5;
double b[5], c[5];
int i, a=0,g=0;
cout << "Массив b = " << endl;
for (i = 0; i < n; i++)
{
cin >> b[i];
if (b[i] > 0)
{
for (a; a <= i; a++)
{
c[a] = b[i];
g++;
}
a = g;
}
}
cout << "Сжатие массива = " << c[a] << endl;
system("PAUSE");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question