
Составить программу, которая создает и выводит на экран массив такого вида: 0 1 1 1 1 1 0 1 0 1 1 1
0 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 1 1 0

Ответы на вопрос

На c++:
#include <iostream>
using namespace std;
int main()
{
int n;
cout << "Длинна последовательности?";
cin >> n;
for(; n>0; n--)
cout << rand()%2;
}



Program to Create and Display an Array
Here is a program in Python that creates and displays an array with the specified pattern:
```python array = [0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0] print(array) ```
This program creates an array with the specified pattern and then prints the array to the console. The array is defined using square brackets `[]`, and the elements are separated by commas. The pattern consists of alternating 0s and 1s.
The output of the program will be: ``` [0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0] ```
Please note that this program is written in Python, but you can adapt it to other programming languages as well.


Топ вопросов за вчера в категории Информатика
Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili