DarkSpect

ContaNumeros

Feb 2nd, 2012
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.15 KB | None | 0 0
  1. int CountDistinct(int v[], int n){  //1
  2.     int cont=n;         //1
  3.     for(int i=0;i<n-1;i++){     //1+n-1+n-1
  4.         if(v[i]==v[i+1])    //1
  5.             cont--      //1
  6.     }
  7. }
Advertisement
Add Comment
Please, Sign In to add comment