Массивы в C++: ввод/вывод

Passage
•
Computers
•
6th - 8th Grade
•
Hard
Еремченко Андрей
Used 16+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Сколько памяти будет занимать данный массив?
4 байта
4n байт
40 байт
n байт
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Как создать и считать массив длиной n?
int a, n;
cin >> n
for(int i = 0; i < n; i++)
cin >> a[i];
int a[n], n;
cin >> n
for(int i = 0; i < n; i++)
cin >> a[i];
int a[100], n;
cin >> n
for(int i = 0; i < n; i++)
cin >> a[i];
int a[], n;
cin >> n
for(int i = 0; i < n; i++)
cin >> a[i];
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Что произойдет, если попытаться обратиться к элементу массива за пределами его размера?
Программа завершится с ошибкой
Будет возвращено значение 0
Будет возвращено случайное значение
Программа продолжит работу, но с непредсказуемым поведением
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Как считается массив, если использовать цикл
for(int i = n; i > 0; i--)
cin >> a[ i - 1 ]
Массив не считается
Произойдет ошибка
Массив считается не весь
Массив считается в обратном порядке
5.
MULTIPLE SELECT QUESTION
1 min • 1 pt
Пусть дан код
int a[100], n;
cin >> n;
Какие циклы вызовут ошибку, если n <= 100?
for(int i = 0; i <=n; i++)
cin >> a[i];
for(int i = 0; i <n; i+=2)
cin >> a[i];
for(int i = n-1; i > 0; i--)
cin >> a[i];
for(int i = 0; i <n; i++)
cin >> a[i];
6.
FILL IN THE BLANK QUESTION
45 sec • 1 pt
Что надо подставить вместо ???, чтобы вывелись только элементы с четным индексом?
for(int i = 0; i < n; ???)
cout << a[i];
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Есть строчки, которые вызовут ошибки?
Да
Нет
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Урок03. Переменные. Ввод-вывод

Quiz
•
6th - 7th Grade
15 questions
Python - тест

Quiz
•
1st - 12th Grade
11 questions
Строки в с++

Quiz
•
8th Grade
12 questions
Programare cu C++ nivel incepatori 5

Quiz
•
6th - 8th Grade
10 questions
C++

Quiz
•
7th - 8th Grade
15 questions
Java Basic Data Structures

Quiz
•
6th - 10th Grade
10 questions
Тест на знание основ Python

Quiz
•
6th - 8th Grade
10 questions
Тест Python

Quiz
•
6th - 8th Grade
Popular Resources on Wayground
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
ELA Advisory Review

Quiz
•
7th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns

Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
25 questions
Exploring POV and Unreliable Narrators

Quiz
•
7th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
20 questions
Typing Practice

Quiz
•
7th - 12th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
20 questions
Input, Output, Processing or Storage

Quiz
•
5th - 6th Grade