🟠  Վարժություն 17

Գրել ծրագիր, որը տրված զանգվածի յուրաքանչյուր էլեմենտի համար կտպի, թե քանի անգամ է այն հանդիպում զանգվածում։
Օրինակ՝
Մուտք - {1, 2, 3, 4, 5, 5, 4}
Ելք - 1:1
2:1
3:1
4:2
5:2
#include <iostream>

int main() {
	const int N = 7;
  int arr[N] = {};
  std::cout << "Input " << N << " size array: ";
  for (int i = 0; i < N; i++) {
     int in;
     std::cin >> in;
     arr[i] = in; 
     std::cout << arr[i] << " ";
  }
  std::cout << std::endl;
  
  // Put your code here
}

Constraints

Time limit: 0.2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue