Ответы
Ответ дал:
0
#include <cstdlib>
#include <iostream>
#include <ctime>
using namespace std;
int main(int argc, char *argv[])
{
int x[10];
srand(time(0));
for(int i=0; i<10; ++i)
x[i]=-rand()%8+5;
long r=(x[0]+2*x[1]+x[2]);
for(int i=2; i<9; ++i)
r*=(x[i-1]+2*x[i]+x[i+1]);
cout <<r<<endl;
system("pause");
return EXIT_SUCCESS;
}
#include <iostream>
#include <ctime>
using namespace std;
int main(int argc, char *argv[])
{
int x[10];
srand(time(0));
for(int i=0; i<10; ++i)
x[i]=-rand()%8+5;
long r=(x[0]+2*x[1]+x[2]);
for(int i=2; i<9; ++i)
r*=(x[i-1]+2*x[i]+x[i+1]);
cout <<r<<endl;
system("pause");
return EXIT_SUCCESS;
}
Похожие вопросы
2 года назад
2 года назад
7 лет назад
7 лет назад
10 лет назад