Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string>
- #include <iostream>
- using namespace std;
- int Count(double array[],int size)
- {
- int count= 0;
- for(int i=0;i<size;i++)
- {
- bool isEqual = false;
- for(int j=size;j>0;j--)
- {
- if(array[i] == array[j] && j!=i){
- isEqual= true;
- }
- }
- if(isEqual == false){
- count++;
- }
- }
- return count;
- }
- int main()
- {
- double array[6] = {1,2,3,8,2,10};
- cout << Count(array,6) << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment