Sunday, April 30, 2017

URI Solution 1171 Number Frequence - Solution in C++ | Ad Hoc

URI Solution 1171 Number Frequence - Solution in C++ | Ad Hoc


URI Online Judge Solution  Number Frequence | Ad Hoc
URI 1171 Main Link - https://www.urionlinejudge.com.br/judge/en/problems/view/1171

Problem Name: URI Problem Number Frequence
Problem Number : URI - 1171
Online Judge : URI Online Judge Solution
Level: Ad Hoc
Solution Language : C plus plus

URI Solution 1171 Code in CPP:


#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
 int n, x, counter = 0;
 int array [2001];
 int array_copy [2001];

 fill(array, array + 2001, 0);
 cin >> n;

 for (int i = 0; i < n; ++i)
 {
  cin >> x;
  array[x] += 1;
 }

 for (int i = 0; i < 2001; ++i)
 {
  if(array[i] != 0){
   cout << i << " aparece " << array[i] << " vez(es)" << endl;
  }
 }
 return 0;
}

No comments:
Write comments

To know more about the problem, give us your valuable commment. We'll try to help you. Thanks

All rights reserved ©2016 -URI ONLINE JUDGE SOLUTION | Developed by Maniruzzaman Akash

© 2016 URI ONLINE JUDGE SOLUTION. Developed by Maniruzzaman Akash | Distributed By Gooyaabi Templates
Powered by Blogger.