Write a C++ program using `std::map` to count word frequencies and print them sorted by keys.
First line: N. Next N lines: string keys.
Print key and frequency pairs row by row.
1 <= N <= 100
4 apple banana apple cherry
apple: 2 banana: 1 cherry: 1
Maps store key-value pairs sorted automatically by unique keys.
#include <iostream>
#include <map>
#include <string>
int main() {
int n;
if (std::cin >> n) {
std::map<std::string, int> freq;
for (int i = 0; i < n; i++) {
std::string s;
std::cin >> s;
freq[s]++;
}
// Write your map output logic here
}
return 0;
}Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used