Hàm 1
Quiz
•
Computers
•
6th Grade
•
Practice Problem
•
Medium
Edu TSmart
Used 12+ times
FREE Resource
Enhance your content in a minute
31 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Khai báo nào sau đây là đúng để tạo một map lưu tên (string) và điểm số (int)?
map<string, int> m;
map<int, string> m;
unordered_map<string, int> m;
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Giá trị mặc định khi truy cập map["abc"] mà chưa có key "abc" là gì?
Gây lỗi
Chèn "abc" với giá trị mặc định (0 nếu kiểu int)
Bỏ qua không làm gì
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Để đếm tần suất xuất hiện của từng số nguyên trong một mảng, ta nên dùng:
map<int, int>
vector<int>
set<int>
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Tính chất nào đúng với map trong C++?
Duy trì thứ tự theo thời gian thêm phần tử
Tự động sắp xếp theo key tăng dần
Không sắp xếp các phần tử
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Giả sử có map
Gán giá trị "abc" cho key 3
Xóa key 3 khỏi map
Gây lỗi vì chưa khởi tạo map
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Cách tốt nhất để kiểm tra một key tồn tại trong map là?
Dùng m[key]
Dùng m.find(key) != m.end()
Dùng m.count(key) > 1
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Câu nào đúng để duyệt qua toàn bộ phần tử trong map
for(auto x : m)
for(int i = 0; i < m.size(); i++)
while(!m.empty())
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
30 questions
Bài ôn tập THQT K6
Quiz
•
6th Grade
26 questions
Assesmen TIK
Quiz
•
6th - 8th Grade
27 questions
Python 2d topic (типы данных, ввод, вывод)
Quiz
•
6th - 12th Grade
27 questions
Level 1_ Chủ đề 3_Test1
Quiz
•
6th Grade
26 questions
Tin 8. Ôn tập GK2
Quiz
•
6th - 8th Grade
27 questions
Ôn tập KTCK2 Tin 6 22 - 23
Quiz
•
6th Grade
28 questions
Level1_Chủ đề 1_ Test 1
Quiz
•
6th Grade
30 questions
9.1 - Computer Crime and Cyber Security
Quiz
•
4th - 9th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
