Массивы в 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
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
9 questions
Introduction To Python
Quiz
•
6th - 8th Grade
14 questions
Baze podataka - 8. razred
Quiz
•
8th Grade
11 questions
Cascading Style Sheets
Quiz
•
8th - 12th Grade
15 questions
Начала программирования на языке Паскаль
Quiz
•
8th - 11th Grade
15 questions
Quiz informatyczny
Quiz
•
1st - 8th Grade
11 questions
What is a computer
Quiz
•
KG - University
10 questions
7 ICT Sem 2 Reviewer
Quiz
•
7th Grade
13 questions
Nhập môn HTML
Quiz
•
6th - 9th Grade
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
6 questions
FOREST Self-Discipline
Lesson
•
1st - 5th Grade
7 questions
Veteran's Day
Interactive video
•
3rd Grade
20 questions
Weekly Prefix check #2
Quiz
•
4th - 7th Grade
