Witam
dla poniższego kodu
#include <iostream>
#include <stdio.h>
#include <map>
map<int, int> mapaWystapionychZnakow;
int main()
{
int iloscWszystkichZnakow = 0;
int liczba;
int i;
float procentowaIlosc;
while((i = getchar()) != '\n')
{
//nie istnieje element o podanym kluczu
if(!mapaWystapionychZnakow.find(i))
mapaWystapionychZnakow[i] = 1;
else
{
liczba = mapaWystapionychZnakow[i] + 1;
mapaWystapionychZnakow[i] = liczba;
}
}
map<int, int>::iterator it;
for(it = mapaWystapionychZnakow.begin(); it != mapaWystapionychZnakow.end(); ++it)
{
printf("%c = %d", *it, it->second);
}
return 0;
}
Wyświetla mi się błąd
|5|error: expected constructor, destructor, or type conversion before '<' token|
|In function 'int main()':|
|16|error: 'mapaWystapionychZnakow' was not declared in this scope|
|24|error: 'map' was not declared in this scope|
|24|error: expected primary-expression before 'int'|
|24|error: expected ';' before 'int'|
|25|error: 'it' was not declared in this scope|
|25|error: 'mapaWystapionychZnakow' was not declared in this scope|
Dziękuje za pomoc.